move enabled callbacks flag down to wxSocketImplUnix from wxSocketImplFDIO, this allows to get rid of the letter

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-28 15:01:41 +00:00
parent a9d859df6f
commit acd523a964
2 changed files with 27 additions and 39 deletions

View File

@@ -27,6 +27,7 @@ public:
m_fds[1] = -1;
m_use_events = false;
m_enabledCallbacks = 0;
}
virtual void Shutdown();
@@ -42,6 +43,14 @@ public:
virtual void OnWriteWaiting();
virtual void OnExceptionWaiting();
// Unix-specific functions
bool HasAnyEnabledCallbacks() const { return m_enabledCallbacks != 0; }
void EnableCallback(wxFDIODispatcherEntryFlags flag)
{ m_enabledCallbacks |= flag; }
void DisableCallback(wxFDIODispatcherEntryFlags flag)
{ m_enabledCallbacks &= ~flag; }
int GetEnabledCallbacks() const { return m_enabledCallbacks; }
private:
virtual wxSocketError DoHandleConnect(int ret);
virtual void DoClose()
@@ -99,6 +108,7 @@ private:
int Send_Stream(const char *buffer, int size);
int Send_Dgram(const char *buffer, int size);
protected:
// true if socket should fire events
bool m_use_events;
@@ -107,6 +117,13 @@ protected:
// with the socket
int m_fds[2];
// the events which are currently enabled for this socket, combination of
// wxFDIO_INPUT and wxFDIO_OUTPUT values
//
// TODO: this overlaps with m_detected but the semantics of the latter are
// very unclear so I don't dare to remove it right now
int m_enabledCallbacks;
private:
// notify the associated wxSocket about a change in socket state and shut
// down the socket if the event is wxSOCKET_LOST