Factor out socket flag selection into GetBlockingFlagIfNeeded()
No real changes, just refactor wxProtocol ctor to use a new function that can be reused elsewhere too.
This commit is contained in:
@@ -65,9 +65,7 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxProtocol, wxObject);
|
||||
wxProtocol::wxProtocol()
|
||||
#if wxUSE_SOCKETS
|
||||
// Only use non blocking sockets if we can dispatch events.
|
||||
: wxSocketClient((wxIsMainThread() && wxApp::IsMainLoopRunning()
|
||||
? wxSOCKET_NONE
|
||||
: wxSOCKET_BLOCK) | wxSOCKET_WAITALL)
|
||||
: wxSocketClient(wxSocketClient::GetBlockingFlagIfNeeded() | wxSOCKET_WAITALL)
|
||||
#endif
|
||||
{
|
||||
m_lastError = wxPROTO_NOERR;
|
||||
|
||||
Reference in New Issue
Block a user