Merge branch 'sock-event-fix'

Fix unwanted (and sometimes fatal) socket events for blocking sockets
under Unix.

See https://github.com/wxWidgets/wxWidgets/pull/1658
This commit is contained in:
Vadim Zeitlin
2019-12-03 02:25:18 +01:00
5 changed files with 49 additions and 25 deletions

View File

@@ -57,10 +57,7 @@ public:
// anything here
}
private:
virtual void DoClose() wxOVERRIDE;
virtual void UnblockAndRegisterWithEventLoop() wxOVERRIDE
virtual void UpdateBlockingState() wxOVERRIDE
{
if ( GetSocketFlags() & wxSOCKET_BLOCK )
{
@@ -74,6 +71,9 @@ private:
// would result in data races and other unpleasantness.
wxIoctlSocketArg_t trueArg = 1;
ioctlsocket(m_fd, FIONBIO, &trueArg);
// Uninstall it in case it was installed before.
wxSocketManager::Get()->Uninstall_Callback(this);
}
else
{
@@ -83,6 +83,9 @@ private:
}
}
private:
virtual void DoClose() wxOVERRIDE;
int m_msgnumber;
friend class wxSocketMSWManager;