diff options
-rw-r--r-- | include/socketengine_iocp.h | 4 | ||||
-rw-r--r-- | src/socketengine_iocp.cpp | 9 | ||||
-rw-r--r-- | win/inspircd_win32wrapper.h | 3 |
3 files changed, 13 insertions, 3 deletions
diff --git a/include/socketengine_iocp.h b/include/socketengine_iocp.h index e45f8e726..cf1a08c4c 100644 --- a/include/socketengine_iocp.h +++ b/include/socketengine_iocp.h @@ -222,6 +222,10 @@ public: virtual int NonBlocking(int fd); virtual int GetSockName(EventHandler* fd, sockaddr *name, socklen_t* name); + + virtual int Close(int fd); + + virtual int Close(EventHandler* fd); }; /** Creates a SocketEngine diff --git a/src/socketengine_iocp.cpp b/src/socketengine_iocp.cpp index f1f4f0289..f7448f85f 100644 --- a/src/socketengine_iocp.cpp +++ b/src/socketengine_iocp.cpp @@ -504,4 +504,13 @@ int IOCPEngine::NonBlocking(int fd) ioctlsocket(s, FIONBIO, &opt); } +int IOCPEngine::Close(int fd) +{ + return closesocket(socket); +} + +int IOCPEngine::Close(EventHandler* fd) +{ + return this->Close(fd->GetFd()); +} diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index a728cf191..6d03d0507 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -79,9 +79,6 @@ #define EADDRINUSE WSAEADDRINUSE #define EINPROGRESS WSAEWOULDBLOCK -/* Remember file descriptors are treated differently on windows ;) */ -__inline int close(int socket) { return closesocket(socket); } - /* Convert formatted (xxx.xxx.xxx.xxx) string to in_addr struct */ CoreExport int inet_pton(int af, const char * src, void * dst); |