\constfunc{bool}{IsData}{\void}
-Returns TRUE if the socket is readable. This might mean that
+This function waits until the socket is readable. This might mean that
queued data is available for reading or, for streamed sockets, that
-the connection has been closed, so that a \helpref{Read}{wxsocketbaseread},
-\helpref{ReadMsg}{wxsocketbasereadmsg} or \helpref{Peek}{wxsocketbasepeek}
-operation is guaranteed to complete immediately (unless the
-{\bf wxSOCKET\_WAITALL} flag is set).
+the connection has been closed, so that a read operation will complete
+immediately without blocking (unless the {\bf wxSOCKET\_WAITALL} flag
+is set, in which case the operation might still block).
\membersection{wxSocketBase::IsDisconnected}\label{wxsocketbaseisdisconnected}
This function waits until the socket is readable. This might mean that
queued data is available for reading or, for streamed sockets, that
-the connection has been closed, so that a \helpref{Read}{wxsocketbaseread},
-\helpref{ReadMsg}{wxsocketbasereadmsg} or \helpref{Peek}{wxsocketbasepeek}
-operation is guaranteed to complete immediately (unless the
-{\bf wxSOCKET\_WAITALL} flag is set).
+the connection has been closed, so that a read operation will complete
+immediately without blocking (unless the {\bf wxSOCKET\_WAITALL} flag
+is set, in which case the operation might still block).
\wxheading{Parameters}
\wxheading{Return value}
-Returns TRUE if there is data to be read, FALSE if the timeout was reached
-or an error occured.
+Returns TRUE if the socket becomes readable, FALSE on timeout.
\wxheading{See also}
This function waits until the socket becomes writable. This might mean that
the socket is ready to send new data, or for streamed sockets, that the
-connection has been closed, so that a \helpref{Write}{wxsocketbasewrite}
-or \helpref{ReadMsg}{wxsocketbasewritemsg} operation is guaranteed to
-complete immediately (unless the {\bf wxSOCKET\_WAITALL} flag is set).
+connection has been closed, so that a write operation is guaranteed to
+complete immediately (unless the {\bf wxSOCKET\_WAITALL} flag is set,
+in which case the operation might still block).
\wxheading{Parameters}
\wxheading{Return value}
-Returns TRUE if the socket becomes writable, FALSE if the timeout was reached.
+Returns TRUE if the socket becomes writable, FALSE on timeout.
\wxheading{See also}
\wxheading{Return value}
-If the connection is succesfully established, returns TRUE.
+WaitOnConnect returns TRUE if the connection request completes. This
+does not necessarily mean that the connection was succesfully established;
+it might also happen that the connection was refused by the peer. Use
+\helpref{IsConnected}{wxsocketbaseisconnected} to distinguish between
+these two situations.
+
+If the timeout elapses, WaitOnConnect returns FALSE.
+
+These semantics allow code like this:
-If the timeout expires, or if the connection fails, returns FALSE.
-To distinguish between these two conditions, use \helpref{IsConnected}{wxsocketbaseisconnected}
+\begin{verbatim}
+// Issue the connection request
+client->Connect(addr, FALSE);
+
+// Wait until the request completes or until we decide to give up
+bool waitmore = TRUE;
+while ( !client->WaitOnConnect(seconds, millis) && waitmore )
+{
+ // possibly give some feedback to the user,
+ // and update waitmore if needed.
+}
+bool success = client->IsConnected();
+\end{verbatim}
\wxheading{See also}