%% Modified by:
%% Created: 1999
%% RCS-ID: $Id$
-%% Copyright: (c) wxWindows team
-%% License: wxWindows license
+%% Copyright: (c) wxWidgets team
+%% License: wxWidgets license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxSocketBase}}\label{wxsocketbase}
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}
Callback functions are also available, but they are provided for backwards
compatibility only. Their use is strongly discouraged in favour of events,
and should be considered deprecated. Callbacks may be unsupported in future
-releases of wxWindows.
+releases of wxWidgets.
\helpref{Callback}{wxsocketbasecallback}\\
\helpref{CallbackData}{wxsocketbasecallbackdata}
\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
%