]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/socket.h
Don't create multiple parent-less top level frames in layout sample.
[wxWidgets.git] / include / wx / socket.h
index 5181d3b4750e702596766778471ffe83b9506aa1..0d0a0d7b5ca9f46ea5278e69180740a11980eb25 100644 (file)
@@ -30,6 +30,16 @@ class wxSocketImpl;
 // Types and constants
 // ------------------------------------------------------------------------
 
 // Types and constants
 // ------------------------------------------------------------------------
 
+// Define the type of native sockets.
+#if defined(__WINDOWS__)
+    // Although socket descriptors are still 32 bit values, even under Win64,
+    // the socket type is 64 bit there.
+    typedef wxUIntPtr wxSOCKET_T;
+#else
+    typedef int wxSOCKET_T;
+#endif
+
+
 // Types of different socket notifications or events.
 //
 // NB: the values here should be consecutive and start with 0 as they are
 // Types of different socket notifications or events.
 //
 // NB: the values here should be consecutive and start with 0 as they are
@@ -71,17 +81,17 @@ enum wxSocketError
 // socket options/flags bit masks
 enum
 {
 // socket options/flags bit masks
 enum
 {
-    wxSOCKET_NONE 0,
-    wxSOCKET_NOWAIT = 1,
-    wxSOCKET_WAITALL = 2,
-    wxSOCKET_BLOCK = 4,
-    wxSOCKET_REUSEADDR = 8,
-    wxSOCKET_BROADCAST = 16,
-    wxSOCKET_NOBIND = 32,
-    wxSOCKET_NOWAIT_READ = 64,
-    wxSOCKET_WAITALL_READ = 128,
-    wxSOCKET_NOWAIT_WRITE = 256,
-    wxSOCKET_WAITALL_WRITE = 512
+    wxSOCKET_NONE           = 0x0000,
+    wxSOCKET_NOWAIT_READ    = 0x0001,
+    wxSOCKET_NOWAIT_WRITE   = 0x0002,
+    wxSOCKET_NOWAIT         = wxSOCKET_NOWAIT_READ | wxSOCKET_NOWAIT_WRITE,
+    wxSOCKET_WAITALL_READ   = 0x0004,
+    wxSOCKET_WAITALL_WRITE  = 0x0008,
+    wxSOCKET_WAITALL        = wxSOCKET_WAITALL_READ | wxSOCKET_WAITALL_WRITE,
+    wxSOCKET_BLOCK          = 0x0010,
+    wxSOCKET_REUSEADDR      = 0x0020,
+    wxSOCKET_BROADCAST      = 0x0040,
+    wxSOCKET_NOBIND         = 0x0080
 };
 
 typedef int wxSocketFlags;
 };
 
 typedef int wxSocketFlags;
@@ -187,6 +197,9 @@ public:
     void SetNotify(wxSocketEventFlags flags);
     void Notify(bool notify);
 
     void SetNotify(wxSocketEventFlags flags);
     void Notify(bool notify);
 
+    // Get the underlying socket descriptor.
+    wxSOCKET_T GetSocket() const;
+
     // initialize/shutdown the sockets (done automatically so there is no need
     // to call these functions usually)
     //
     // initialize/shutdown the sockets (done automatically so there is no need
     // to call these functions usually)
     //