X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/df21920b800cf87bce324de8a2f2aef878fbbf80..abd474ea63667f727940a009cc3e0b23ba9f418f:/src/unix/sockunix.cpp diff --git a/src/unix/sockunix.cpp b/src/unix/sockunix.cpp index c50debc326..0bcaa363b9 100644 --- a/src/unix/sockunix.cpp +++ b/src/unix/sockunix.cpp @@ -66,13 +66,6 @@ // wxSocketImpl implementation // ============================================================================ -/* static */ -wxSocketImpl *wxSocketImpl::Create(wxSocketBase& wxsocket) -{ - return new wxSocketImplUnix(wxsocket); -} - - wxSocketError wxSocketImplUnix::GetLastError() const { switch ( errno ) @@ -107,6 +100,9 @@ wxSocketError wxSocketImplUnix::GetLastError() const void wxSocketImplUnix::DoEnableEvents(int flags, bool enable) { wxSocketManager * const manager = wxSocketManager::Get(); + if (!manager) + return; + if ( enable ) { if ( flags & wxSOCKET_INPUT_FLAG ) @@ -234,7 +230,15 @@ void wxSocketImplUnix::OnWriteWaiting() void wxSocketImplUnix::OnExceptionWaiting() { - wxFAIL_MSG( "not supposed to be called" ); + // when using epoll() this is called when an error occurred on the socket + // so close it if it hadn't been done yet -- what else can we do? + // + // notice that we shouldn't be called at all when using select() as we + // don't use wxFDIO_EXCEPTION when registering the socket for monitoring + // and this is good because select() would call this for any OOB data which + // is not necessarily an error + if ( m_fd != INVALID_SOCKET ) + OnStateChange(wxSOCKET_LOST); } #endif /* wxUSE_SOCKETS */