From 021d09af1375834fe9aaca916e60dcd2ad3be845 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 7 Jul 2017 18:17:51 -0700 Subject: Start of progress on Windows. Name resolution and IOCP work begins. --- src/platform/windows/win_impl.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'src/platform/windows/win_impl.h') diff --git a/src/platform/windows/win_impl.h b/src/platform/windows/win_impl.h index 7bb71707..85f73bf7 100644 --- a/src/platform/windows/win_impl.h +++ b/src/platform/windows/win_impl.h @@ -26,18 +26,19 @@ // These types are provided for here, to permit them to be directly inlined // elsewhere. -struct nni_plat_tcpsock { - SOCKET s; - - WSAOVERLAPPED recv_olpd; - WSAOVERLAPPED send_olpd; - WSAOVERLAPPED conn_olpd; // Use for both connect and accept - int family; - - // We have to lookup some function pointers using ioctls. Winsock, - // gotta love it. - LPFN_CONNECTEX connectex; - LPFN_ACCEPTEX acceptex; +typedef struct nni_win_event nni_win_event; + +// nni_win_event is used with io completion ports. This allows us to get +// to a specific completion callback without requiring the poller (in the +// completion port) to know anything about the event itself. We also use +// this to pass back status and counts to the routine, which may not be +// conveyed in the OVERLAPPED directly. +struct nni_win_event { + OVERLAPPED olpd; + void * ptr; + nni_cb cb; + int status; + int nbytes; }; struct nni_plat_ipcsock { @@ -69,8 +70,15 @@ struct nni_plat_cv { CRITICAL_SECTION * cs; }; +extern int nni_win_error(int); extern int nni_winsock_error(int); +extern int nni_win_iocp_sysinit(void); +extern void nni_win_iocp_sysfini(void); + +extern int nni_win_resolv_sysinit(void); +extern void nni_win_resolv_sysfini(void); + #endif // PLATFORM_WINDOWS #endif // PLATFORM_WIN_IMPL_H -- cgit v1.2.3-70-g09d2