+ wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
+
+ if (condition & G_IO_IN)
+ {
+ handler->OnReadWaiting();
+
+ // 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->IsOk() )
+ return true;
+ }
+
+ if (condition & G_IO_OUT)
+ handler->OnWriteWaiting();