Commit f52757fd68d626da2a20db61b690a22913251206
1 parent
2fef04ac
Exists in
master
and in
1 other branch
Mudando gerenciamento da comunicacao em windows
Showing
1 changed file
with
21 additions
and
1 deletions
Show diff stats
iocallback.c
@@ -182,7 +182,27 @@ static gboolean IO_check(GSource *source) | @@ -182,7 +182,27 @@ static gboolean IO_check(GSource *source) | ||
182 | */ | 182 | */ |
183 | #ifdef _WIN32 | 183 | #ifdef _WIN32 |
184 | 184 | ||
185 | - #error AQUI | 185 | + fd_set rfds, wfds, xfds; |
186 | + struct timeval tm; | ||
187 | + | ||
188 | + memset(&tm,0,sizeof(tm)); | ||
189 | + | ||
190 | + FD_ZERO(&rfds); | ||
191 | + FD_ZERO(&wfds); | ||
192 | + FD_ZERO(&xfds); | ||
193 | + | ||
194 | + if(((IO_Source *) source)->poll.events & G_IO_IN) | ||
195 | + { | ||
196 | + FD_SET(((IO_Source *) source)->poll.fd, &rfds); | ||
197 | + } | ||
198 | + | ||
199 | + if(((IO_Source *) source)->poll.events & G_IO_OUT) | ||
200 | + { | ||
201 | + FD_SET(((IO_Source *) source)->poll.fd, &wfds); | ||
202 | + } | ||
203 | + | ||
204 | + if(select(((IO_Source *) source)->poll.fd+1, &rfds, &wfds, &xfds, &tm) > 0) | ||
205 | + return TRUE; | ||
186 | 206 | ||
187 | #else | 207 | #else |
188 | 208 |