diff options
author | root <root> | 2010-10-23 22:25:44 +0000 |
---|---|---|
committer | root <root> | 2010-10-23 22:25:44 +0000 |
commit | b5d13e01dd9ff8d28910f53a94e009eb74fc36c3 (patch) | |
tree | 089fe5f04aae4f85a014778fb422890e10c09650 /ev.c | |
parent | 955354ad4b62d43d5089fe785ba704f715c0e3d0 (diff) |
*** empty log message ***
Diffstat (limited to 'ev.c')
-rw-r--r-- | ev.c | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -670,9 +670,12 @@ typedef struct #if EV_USE_EPOLL unsigned int egen; /* generation counter to counter epoll bugs */ #endif -#if EV_SELECT_IS_WINSOCKET +#if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP SOCKET handle; #endif +#if EV_USE_IOCP + OVERLAPPED or, ow; +#endif } ANFD; /* stores the pending event set for a given watcher */ @@ -977,12 +980,13 @@ fd_reify (EV_P) anfd->reify = 0; -#if EV_SELECT_IS_WINSOCKET +#if EV_SELECT_IS_WINSOCKET || EV_USE_IOCP if (o_reify & EV__IOFDSET) { unsigned long arg; anfd->handle = EV_FD_TO_WIN32_HANDLE (fd); assert (("libev: only socket fds supported in this configuration", ioctlsocket (anfd->handle, FIONREAD, &arg) == 0)); + printf ("oi %d %x\n", fd, anfd->handle);//D } #endif @@ -1491,6 +1495,9 @@ childcb (EV_P_ ev_signal *sw, int revents) /*****************************************************************************/ +#if EV_USE_IOCP +# include "ev_iocp.c" +#endif #if EV_USE_PORT # include "ev_port.c" #endif @@ -1697,6 +1704,9 @@ loop_init (EV_P_ unsigned int flags) if (!(flags & 0x0000ffffU)) flags |= ev_recommended_backends (); +#if EV_USE_IOCP + if (!backend && (flags & EVBACKEND_IOCP )) backend = iocp_init (EV_A_ flags); +#endif #if EV_USE_PORT if (!backend && (flags & EVBACKEND_PORT )) backend = port_init (EV_A_ flags); #endif @@ -1758,6 +1768,9 @@ loop_destroy (EV_P) if (backend_fd >= 0) close (backend_fd); +#if EV_USE_IOCP + if (backend == EVBACKEND_IOCP ) iocp_destroy (EV_A); +#endif #if EV_USE_PORT if (backend == EVBACKEND_PORT ) port_destroy (EV_A); #endif |