use guard classes automatically restoring the old state in their dtor instead of manually changing wxSocketBase::m_reading/writing/flags

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57778 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-02 17:34:16 +00:00
parent 9d77a075c0
commit 365b8793d3
2 changed files with 100 additions and 41 deletions

View File

@@ -245,7 +245,8 @@ private:
bool m_closed; // was the other end closed?
wxUint32 m_lcount; // last IO transaction size
unsigned long m_timeout; // IO timeout value in seconds
wxList m_states; // stack of states
// (TODO: remove, wxSocketImpl has it too)
wxList m_states; // stack of states (TODO: remove!)
bool m_interrupt; // interrupt ongoing wait operations?
bool m_beingDeleted; // marked for delayed deletion?
wxIPV4address m_localAddress; // bind to local address?
@@ -263,9 +264,13 @@ private:
wxSocketEventFlags m_eventmask; // which events to notify?
wxSocketEventFlags m_eventsgot; // collects events received in OnRequest()
// the initialization count, GSocket is initialized if > 0
// the initialization count, wxSocket is initialized if > 0
static size_t m_countInit;
friend class wxSocketReadGuard;
friend class wxSocketWriteGuard;
DECLARE_NO_COPY_CLASS(wxSocketBase)
DECLARE_CLASS(wxSocketBase)
};