/* This whole file is actually win32 only. We wrap the structures in a win32 *ifdefsothatwecantest-compilecodethatusestheseinterfaceson
* non-win32 platforms. */ #ifdef _WIN32
/** Internal use only. Holds pointers to functions that only some versions of Windowsprovide.
*/ struct win32_extension_fns {
AcceptExPtr AcceptEx;
ConnectExPtr ConnectEx;
GetAcceptExSockaddrsPtr GetAcceptExSockaddrs;
};
/** Internaluseonly.StoresaWindowsIOCompletionport,alongwith relateddata.
*/ struct event_iocp_port { /** The port itself */
HANDLE port; /* A lock to cover internal structures. */
CRITICAL_SECTION lock; /** Number of threads ever open on the port. */ short n_threads; /** True iff we're shutting down all the threads on this port */ short shutdown; /** How often the threads on this port check for shutdown and other
* conditions */ long ms; /* The threads that are waiting for events. */
HANDLE *threads; /** Number of threads currently open on this port. */ short n_live_threads; /** A semaphore to signal when we are done shutting down. */
HANDLE *shutdownSemaphore;
};
EVENT2_EXPORT_SYMBOL conststruct win32_extension_fns *event_get_win32_extension_fns_(void); #else /* Dummy definition so we can test-compile more things on unix. */ struct event_overlapped {
iocp_callback cb;
}; #endif
/** Allocate and return a new evbuffer that supports overlapped IO on a given socket.ThesocketmustbeassociatedwithanIOcompletionportusing event_iocp_port_associate_.
*/
EVENT2_EXPORT_SYMBOL struct evbuffer *evbuffer_overlapped_new_(evutil_socket_t fd);
/** Associate a file descriptor with an iocp, such that overlapped IO on the fdwillhappenononeoftheiocp'sworkerthreads.
*/
EVENT2_EXPORT_SYMBOL int event_iocp_port_associate_(struct event_iocp_port *port, evutil_socket_t fd,
ev_uintptr_t key);
/** Tell all threads serving an iocp to stop. Wait for up to waitMsec for all thethreadstofinishwhateverthey'redoing.IfwaitMsecis-1,wait aslongasrequired.Ifallthethreadsaredone,freetheportandreturn 0.Otherwise,return-1.Ifyougeta-1returnvalue,itissafetocall thisfunctionagain.
*/
EVENT2_EXPORT_SYMBOL int event_iocp_shutdown_(struct event_iocp_port *port, long waitMsec);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.