]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/socket.h
added default ctor and Create() to wxRearrangeDialog for consistency
[wxWidgets.git] / include / wx / socket.h
index 1b72a2cd56eb22b46cd6f850f768779616a6355d..2ce26e53456cb4e03e87f0fe4aa2f0a81828ec6e 100644 (file)
@@ -39,8 +39,7 @@ enum wxSocketNotify
     wxSOCKET_INPUT,
     wxSOCKET_OUTPUT,
     wxSOCKET_CONNECTION,
-    wxSOCKET_LOST,
-    wxSOCKET_MAX_EVENT
+    wxSOCKET_LOST
 };
 
 enum
@@ -101,8 +100,6 @@ enum wxSocketType
 
 class WXDLLIMPEXP_NET wxSocketBase : public wxObject
 {
-  DECLARE_CLASS(wxSocketBase)
-
 public:
 
   // Public interface
@@ -118,7 +115,7 @@ public:
   // state
   bool Ok() const { return IsOk(); }
   bool IsOk() const { return m_impl != NULL; }
-  bool Error() const { return m_error; }
+  bool Error() const { return LastError() != wxSOCKET_NOERROR; }
   bool IsClosed() const { return m_closed; }
   bool IsConnected() const { return m_connected; }
   bool IsData() { return WaitForRead(0, 0); }
@@ -135,6 +132,7 @@ public:
 
   // base IO
   virtual bool  Close();
+  void ShutdownOutput();
   wxSocketBase& Discard();
   wxSocketBase& Peek(void* buffer, wxUint32 nbytes);
   wxSocketBase& Read(void* buffer, wxUint32 nbytes);
@@ -219,6 +217,9 @@ private:
   void     Pushback(const void *buffer, wxUint32 size);
   wxUint32 GetPushback(void *buffer, wxUint32 size, bool peek);
 
+  // store the given error as the LastError()
+  void SetError(wxSocketError error);
+
 private:
   // socket
   wxSocketImpl *m_impl;             // port-specific implementation
@@ -230,9 +231,7 @@ private:
   bool          m_establishing;     // establishing connection?
   bool          m_reading;          // busy reading?
   bool          m_writing;          // busy writing?
-  bool          m_error;            // did last IO call fail?
   bool          m_closed;           // was the other end closed?
-                                    // (notice that m_error is also set then)
   wxUint32      m_lcount;           // last IO transaction size
   unsigned long m_timeout;          // IO timeout value in seconds
   wxList        m_states;           // stack of states
@@ -251,11 +250,13 @@ private:
   void         *m_clientData;       // client data for events
   bool          m_notify;           // notify events to users?
   wxSocketEventFlags  m_eventmask;  // which events to notify?
+  wxSocketEventFlags  m_eventsgot;  // collects events received in OnRequest()
 
   // the initialization count, GSocket is initialized if > 0
   static size_t m_countInit;
 
   DECLARE_NO_COPY_CLASS(wxSocketBase)
+  DECLARE_CLASS(wxSocketBase)
 };