Derived from
Include files
<wx/socket.h>
wxSocketClient::wxSocketClient
wxSocketClient::~wxSocketClient
wxSocketClient::Connect
wxSocketClient::WaitOnConnect
wxSocketClient(wxSockFlags flags = wxSocketBase::NONE)
Constructs a new wxSocketClient.
Parameters
flags
~wxSocketClient()
Destroys a wxSocketClient object.
bool Connect(wxSockAddress& address, bool wait = TRUE)
Connects to a server using the specified address.
If wait is TRUE, Connect will wait until the connection completes and the socket is ready to send or receive data, or until an event occurs.
Warning ! This will block the GUI.
If wait is FALSE, Connect will try to establish the connection and return immediately, without blocking the GUI. When used this way, even if Connect returns FALSE, the connection request can be completed later. To detect this, use WaitConnection, or watch "connection" events (for succesful establishment) and "lost" events (for connection failure).
Parameters
address
wait
Return value
Returns TRUE if the connection is established and no error occurs.
If wait was TRUE, and Connect returns FALSE, an error occured and the connection failed.
If wait was FALSE, and Connect returns FALSE, you should still be prepared to handle the completion of this connection request, either with WaitOnConnect or by watching "connection" and "lost" events.
See also
wxSocketClient::WaitOnConnect, wxSocketBase::SetNotify, wxSocketBase::Notify
bool WaitOnConnect(long seconds = -1, long milliseconds = 0)
Wait until the connection is succesfully established or until it fails. Use this function after a call to Connect with wait set to FALSE.
Parameters
seconds
millisecond
Return value
If the connection is succesfully established, it returns TRUE.
If the timeout expires, or if the connection fails, it returns FALSE.
See also