Use closesocket() for closing sockets under MSW
If accepting a socket connection failed, wxSocketImpl::Accept() used close() to close the socket even under MSW, but it can be only used for the file descriptors there and closesocket() must be used instead for the sockets. Add new (private) wxCloseSocket define and use it both here, to fix the bug, and elsewhere to make the code more clear. Closes #18407.
This commit is contained in:
committed by
Vadim Zeitlin
parent
b309868930
commit
a4f2303361
@@ -23,6 +23,8 @@
|
||||
|
||||
#include "wx/private/fdiomanager.h"
|
||||
|
||||
#define wxCloseSocket close
|
||||
|
||||
class wxSocketImplUnix : public wxSocketImpl,
|
||||
public wxFDIOHandler
|
||||
{
|
||||
@@ -64,7 +66,7 @@ private:
|
||||
{
|
||||
DisableEvents();
|
||||
|
||||
close(m_fd);
|
||||
wxCloseSocket(m_fd);
|
||||
}
|
||||
|
||||
virtual void UnblockAndRegisterWithEventLoop() wxOVERRIDE
|
||||
|
Reference in New Issue
Block a user