summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-02-09 17:17:04 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-02-09 17:17:04 +0100
commit4ec65c6231df9fcb38210f9b885cdf73b72cc176 (patch)
tree97bb3a6c46634b2b00c3edaacdb86867a5023423 /src/socketengine.cpp
parent080bb7c0b3d4cc3fcd06d04621ae4780ebbf3f2c (diff)
Call DelFd() and SetFd(-1) from SocketEngine::Close(EventHandler*)
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp11
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)