add wxSocket::IsClosed(), use it to implement Eof() in wxSocketStream

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-07-12 02:28:12 +00:00
parent 74a50e4923
commit c91574928d
4 changed files with 91 additions and 41 deletions

View File

@@ -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