X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7172db18572590af6b79492bcabe284de33bd090..85284ca4b226d9a1ab6bed26c5eaa480543649d5:/src/common/socket.cpp diff --git a/src/common/socket.cpp b/src/common/socket.cpp index c7af4a2600..3227bdb429 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -950,7 +950,9 @@ wxUint32 wxSocketBase::DoRead(void* buffer_, wxUint32 nbytes) // events and, even more importantly, we must do this under Windows // where we're not going to get notifications about socket being ready // for reading before we read all the existing data from it - const int ret = m_connected ? m_impl->Read(buffer, nbytes) : 0; + const int ret = !m_impl->m_stream || m_connected + ? m_impl->Read(buffer, nbytes) + : 0; if ( ret == -1 ) { if ( m_impl->GetLastError() == wxSOCKET_WOULDBLOCK ) @@ -1115,7 +1117,7 @@ wxUint32 wxSocketBase::DoWrite(const void *buffer_, wxUint32 nbytes) wxUint32 total = 0; while ( nbytes ) { - if ( !m_connected ) + if ( m_impl->m_stream && !m_connected ) { if ( (m_flags & wxSOCKET_WAITALL) || !total ) SetError(wxSOCKET_IOERR);