]> git.saurik.com Git - wxWidgets.git/blobdiff - interface/wx/socket.h
no real changes, just some minor cleanup to fix a few compile- and run-time warnings...
[wxWidgets.git] / interface / wx / socket.h
index 8f06f895a6422bb499634edaa937f40331827f06..5edc0cf3063958d158091fed91dbe19989411fc6 100644 (file)
@@ -272,8 +272,8 @@ public:
         @see WaitOnConnect(), wxSocketBase::SetNotify,
              wxSocketBase::Notify
     */
-    bool Connect(wxSockAddress& address, bool wait = true);
-    bool Connect(wxSockAddress& address, wxSockAddress& local,
+    bool Connect(const wxSockAddress& address, bool wait = true);
+    bool Connect(const wxSockAddress& address, const wxSockAddress& local,
                  bool wait = true);
     //@}
 
@@ -499,6 +499,10 @@ public:
         Returns @true if an error occurred in the last IO operation.
         Use this function to check for an error condition after one of the
         following calls: Discard, Peek, Read, ReadMsg, Unread, Write, WriteMsg.
+
+        Notice that this function will return @true even if the other end of a
+        (connected, i.e. TCP) socket was orderly closed by the peer. Use
+        IsClosed() to check for this.
     */
     bool Error() const;
 
@@ -567,6 +571,13 @@ public:
     */
     bool IsConnected() const;
 
+    /**
+        Return @true if the other end of the socket was closed by the peer.
+
+        Notice that Error() will return @true as well when this happens.
+     */
+    bool IsClosed() const;
+
     /**
         This function waits until the socket is readable. This might mean that
         queued data is available for reading or, for streamed sockets, that
@@ -813,7 +824,7 @@ public:
         a local port is set for a wxSocketClient,
         @b bind will be called before @b connect.
     */
-    bool SetLocal(wxIPV4address& local);
+    bool SetLocal(const wxIPV4address& local);
 
     /**
         SetNotify specifies which socket events are to be sent to the event handler.