This will allow to use the base wxFDIOHandler class only in GUI-specific
network code and this remove its dependency on wxSocketImplUnix. IOW it paves
the way for a proper solution of the problem fixed by r61336 without the hack
of r61335 which results in linking problems (which went undiscovered until now
but were, in fact, always present, i.e. r61335 couldn't work).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61685
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// called when there is exception on descriptor
virtual void OnExceptionWaiting() = 0;
+ // called to check if the handler is still valid, only used by
+ // wxSocketImplUnix currently
+ virtual bool IsOk() const { return true; }
+
// virtual dtor for the base class
virtual ~wxFDIOHandler() { }
};
virtual void OnReadWaiting();
virtual void OnWriteWaiting();
virtual void OnExceptionWaiting();
+ virtual bool IsOk() const { return m_fd != INVALID_SOCKET; }
// Unix-specific functions used by wxSocketFDIOManager only
bool HasAnyEnabledCallbacks() const { return m_enabledCallbacks != 0; }
// we could have lost connection while reading in which case we
// shouldn't call OnWriteWaiting() as the socket is now closed and it
// would assert
- if ( handler->m_fd == INVALID_SOCKET )
+ if ( !handler->IsOk() )
return;
}
// we could have lost connection while reading in which case we
// shouldn't call OnWriteWaiting() as the socket is now closed and it
// would assert
- if ( handler->m_fd == INVALID_SOCKET )
+ if ( !handler->IsOk() )
return;
}