React to errors on socket correctly when using epoll().
Even though the socket is not registered for wxFDIO_EXCEPTION events, wxEpollDispatcher will currently generate them anyhow so we shouldn't assert if wxSocketImplUnix::OnExceptionWaiting() is called. Instead, notify the socket about the connection loss if this happens. Closes #11085. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61813 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
9bd1920403
commit
558e196cce
@ -230,7 +230,15 @@ void wxSocketImplUnix::OnWriteWaiting()
|
|||||||
|
|
||||||
void wxSocketImplUnix::OnExceptionWaiting()
|
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 */
|
#endif /* wxUSE_SOCKETS */
|
||||||
|
Loading…
Reference in New Issue
Block a user