diff options
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r-- | src/socketengine.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 698b9061f..86608f0a3 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -147,13 +147,12 @@ int SocketEngine::Accept(EventHandler* fd, sockaddr *addr, socklen_t *addrlen) return accept(fd->GetFd(), addr, addrlen); } -int SocketEngine::Close(EventHandler* fd) +int SocketEngine::Close(EventHandler* eh) { -#ifdef _WIN32 - return closesocket(fd->GetFd()); -#else - return close(fd->GetFd()); -#endif + DelFd(eh); + int ret = Close(eh->GetFd()); + eh->SetFd(-1); + return ret; } int SocketEngine::Close(int fd) |