X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..9d1c7e8474ac6501f6ed39549b91c86eca9aae23:/interface/wx/socket.h diff --git a/interface/wx/socket.h b/interface/wx/socket.h index 2312cf26e0..5edc0cf306 100644 --- a/interface/wx/socket.h +++ b/interface/wx/socket.h @@ -8,7 +8,6 @@ /** @class wxIPV4address - @wxheader{socket.h} @library{wxbase} @@ -63,7 +62,6 @@ public: /** @class wxSocketServer - @wxheader{socket.h} @library{wxnet} @@ -151,7 +149,6 @@ public: /** @class wxIPaddress - @wxheader{socket.h} wxIPaddress is an abstract base class for all internet protocol address objects. Currently, only wxIPV4address @@ -224,7 +221,6 @@ public: /** @class wxSocketClient - @wxheader{socket.h} @library{wxnet} @@ -276,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); //@} @@ -306,7 +302,6 @@ public: /** @class wxSockAddress - @wxheader{socket.h} You are unlikely to need to use this class: only wxSocketBase uses it. @@ -343,7 +338,6 @@ public: /** @class wxSocketEvent - @wxheader{socket.h} This event class contains information about socket events. @@ -382,7 +376,6 @@ public: /** @class wxSocketBase - @wxheader{socket.h} wxSocketBase is the base class for all socket-related objects, and it defines all basic IO functionality. @@ -506,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; @@ -574,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 @@ -820,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. @@ -1027,7 +1031,6 @@ public: /** @class wxDatagramSocket - @wxheader{socket.h} @library{wxnet}