- int Read(char *buffer, int size);
- int Write(const char *buffer, int size);
- //attach or detach from main loop
- void Notify(bool flag);
- void Detected_Read();
- void Detected_Write();
+ virtual void ReenableEvents(wxSocketEventFlags flags)
+ {
+ // enable the notifications about input/output being available again in
+ // case they were disabled by OnRead/WriteWaiting()
+ //
+ // notice that we'd like to enable the events here only if there is
+ // nothing more left on the socket right now as otherwise we're going
+ // to get a "ready for whatever" notification immediately (well, during
+ // the next event loop iteration) and disable the event back again
+ // which is rather inefficient but unfortunately doing it like this
+ // doesn't work because the existing code (e.g. src/common/sckipc.cpp)
+ // expects to keep getting notifications about the data available from
+ // the socket even if it didn't read all the data the last time, so we
+ // absolutely have to continue generating them
+ EnableEvents(flags);
+ }
+
+ // wxFDIOHandler methods
+ virtual void OnReadWaiting();
+ virtual void OnWriteWaiting();
+ virtual void OnExceptionWaiting();
+ virtual bool IsOk() const { return m_fd != INVALID_SOCKET; }