m_fds[0] =
m_fds[1] = -1;
- m_use_events = false;
m_enabledCallbacks = 0;
}
virtual void Shutdown();
virtual wxSocketImpl *WaitConnection(wxSocketBase& wxsocket);
- int Read(char *buffer, int size);
- int Write(const char *buffer, int size);
- //attach or detach from main loop
- void Notify(bool flag);
+ int Read(void *buffer, int size);
+ int Write(const void *buffer, int size);
// wxFDIOHandler methods
virtual void OnReadWaiting();
EnableEvents();
}
- // enable or disable notifications for socket input/output events but only
- // if m_use_events is true; do nothing otherwise
- virtual void EnableEvents()
- {
- if ( m_use_events )
- DoEnableEvents(true);
- }
-
- void DisableEvents()
- {
- if ( m_use_events )
- DoEnableEvents(false);
+ // enable or disable notifications for socket input/output events
+ void EnableEvents() { DoEnableEvents(true); }
+ void DisableEvents() { DoEnableEvents(false);
}
- // really enable or disable socket input/output events, regardless of
- // m_use_events value
+ // really enable or disable socket input/output events
void DoEnableEvents(bool enable);
- // enable or disable events for the given event if m_use_events; do nothing
- // otherwise
+ // enable or disable events for the given event
//
// notice that these functions also update m_detected: EnableEvent() clears
// the corresponding bit in it and DisableEvent() sets it
void EnableEvent(wxSocketNotify event);
void DisableEvent(wxSocketNotify event);
-
- wxSocketError Input_Timeout();
- wxSocketError Output_Timeout();
- int Recv_Stream(char *buffer, int size);
- int Recv_Dgram(char *buffer, int size);
- int Send_Stream(const char *buffer, int size);
- int Send_Dgram(const char *buffer, int size);
+ int Recv_Stream(void *buffer, int size);
+ int Recv_Dgram(void *buffer, int size);
+ int Send_Stream(const void *buffer, int size);
+ int Send_Dgram(const void *buffer, int size);
protected:
- // true if socket should fire events
- bool m_use_events;
-
// descriptors for input and output event notification channels associated
// with the socket
int m_fds[2];