wxSocketBase is the base class for all socket-related objects, and it
defines all basic IO functionality.
+Note: (Workaround for implementation limitation for wxWidgets up to 2.5.x)
+If you want to use sockets or derived classes such as wxFTP in a secondary thread,
+call wxSocketBase::Initialize() (undocumented) from the main thread before creating
+any sockets - in wxApp::OnInit for example.
+See http://wiki.wxwidgets.org/wiki.pl?WxSocket or
+http://www.litwindow.com/knowhow/knowhow.html for more details.
+
\wxheading{Derived from}
\helpref{wxObject}{wxobject}
\latexignore{\rtfignore{\wxheading{Function groups}}}
-\membersection{Construction and destruction}
+\membersection{Construction and destruction}\label{socketconstruction}
\helpref{wxSocketBase}{wxsocketbaseconstruct}\\
\helpref{\destruct{wxSocketBase}}{wxsocketbasedestruct}\\
\helpref{Destroy}{wxsocketbasedestroy}
-\membersection{Socket state}
+\membersection{Socket state}\label{socketstate}
Functions to retrieve current state and miscellaneous info.
\helpref{SaveState}{wxsocketbasesavestate}\\
\helpref{RestoreState}{wxsocketbaserestorestate}
-\membersection{Basic IO}
+\membersection{Basic IO}\label{socketbasicio}
Functions that perform basic IO functionality.
\helpref{SetFlags}{wxsocketbasesetflags}\\
\helpref{SetTimeout}{wxsocketbasesettimeout}
-\membersection{Handling socket events}
+\membersection{Handling socket events}\label{socketevents}
Functions that allow applications to receive socket events.
\twocolitem{{\bf wxSOCKET\_NOWAIT}}{Read/write as much data as possible and return immediately.}
\twocolitem{{\bf wxSOCKET\_WAITALL}}{Wait for all required data to be read/written unless an error occurs.}
\twocolitem{{\bf wxSOCKET\_BLOCK}}{Block the GUI (do not yield) while reading/writing data.}
+\twocolitem{{\bf wxSOCKET\_REUSEADDR}}{Allows the use of an in-use port (wxServerSocket only)}
\end{twocollist}
A brief overview on how to use these flags follows.
completes. If it is not used, then the application must take extra
care to avoid unwanted reentrance.
+The {\bf wxSOCKET\_REUSEADDR} flag controls the use of the SO\_REUSEADDR standard
+setsockopt() flag. This flag allows the socket to bind to a port that is already in use.
+This is mostly used on UNIX-based systems to allow rapid starting and stopping of a server -
+otherwise you may have to wait several minutes for the port to become available.
+This option can have suprising platform dependent behavior, check the documentation for
+your platforms implementation of setsockopt().
+
So:
{\bf wxSOCKET\_NONE} will try to read at least SOME data, no matter how much.
{\bf wxSOCKET\_BLOCK} has nothing to do with the previous flags and
it controls whether the GUI blocks.
+{\bf wxSOCKET\_REUSEADDR} controls special platform-specific behavior for wxServerSocket.
+
%
% SetNotify
%
%
% wxSocketClient
%
-\membersection{wxSocketClient::wxSocketClient}
+\membersection{wxSocketClient::wxSocketClient}\label{wxsocketclientctor}
\func{}{wxSocketClient}{\param{wxSocketFlags}{ flags = wxSOCKET\_NONE}}
%
% ~wxSocketClient
%
-\membersection{wxSocketClient::\destruct{wxSocketClient}}
+\membersection{wxSocketClient::\destruct{wxSocketClient}}\label{wxsocketclientdtor}
\func{}{\destruct{wxSocketClient}}{\void}
\latexignore{\rtfignore{\wxheading{Members}}}
-\membersection{wxSocketEvent::wxSocketEvent}
+\membersection{wxSocketEvent::wxSocketEvent}\label{wxsocketeventctor}
\func{}{wxSocketEvent}{\param{int}{ id = 0}}