<wx/socket.h>
-\wxheading{wxSocket errors}%\label{wxsocketerrs} % Labels don't work on a non-section!
+\wxheading{wxSocket errors}
\twocolwidtha{7cm}
\begin{twocollist}\itemsep=0pt
% ---------------------------------------------------------------------------
\wxheading{See also}
-\helpref{wxSocketEvent}{wxsocketevent}\\
-\helpref{wxSocketClient}{wxsocketclient}\\
+\helpref{wxSocketEvent}{wxsocketevent},
+\helpref{wxSocketClient}{wxsocketclient},
\helpref{wxSocketServer}{wxsocketserver}
% ---------------------------------------------------------------------------
\func{}{wxSocketBase}{\void}
-Default constructor. Don't use it; use \helpref{wxSocketClient}{wxsocketclient}
+Default constructor. Don't use it; use \helpref{wxSocketClient}{wxsocketclient}
or \helpref{wxSocketServer}{wxsocketserver}.
\membersection{wxSocketBase::\destruct{wxSocketBase}}
\twocolitem{{\bf wxSOCKET\_NONE}}{Normal functionnality.}
\twocolitem{{\bf wxSOCKET\_NOWAIT}}{Get the available data in the input queue and return immediately.}
\twocolitem{{\bf wxSOCKET\_WAITALL}}{Wait for all required data unless an error occurs.}
-\twocolitem{{\bf wxSOCKET\_BLOCK}}{Block the GUI (do not wxYield) while reading / writing data.}
+\twocolitem{{\bf wxSOCKET\_BLOCK}}{Block the GUI (do not wxYield) while reading/writing data.}
\end{twocollist}
A brief overview on how to use these flags follows.
"blocking" here refers to when the function returns, not to whether
the GUI blocks during this time.
-The {\bf wxSOCKET\_BLOCK} controls whether the GUI blocks during IO
-operations. If this flag is not used, then the application must take
+The {\bf wxSOCKET\_BLOCK} flag controls whether the GUI blocks during
+IO operations. If this flag is not used, then the application must take
extra care to avoid unwanted reentrance.
So:
{\bf wxSOCKET\_NONE} will try to read SOME data, no matter how much.
+
{\bf wxSOCKET\_NOWAIT} will always return immediately, even if it cannot
read or write ANY data.
+
{\bf wxSOCKET\_WAITALL} will only return when it has read or written ALL
the data.
+
{\bf wxSOCKET\_BLOCK} has nothing to do with the previous flags and
-it control whether the GUI blocks.
+it controls whether the GUI blocks.
%
% SetNotify
\end{twocollist}%
For example:
+
\begin{verbatim}
sock.SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);
\end{verbatim}
+
In this example, the user will be notified about incoming socket data and
whenever the connection is closed.
%
% SetTimeout
%
-\membersection{wxSocketBase::SetTimeout}{wxsocketbasesettimeout}
+\membersection{wxSocketBase::SetTimeout}\label{wxsocketbasesettimeout}
\func{void}{SetTimeout}{\param{int }{seconds}}
\wxheading{See also}
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror},
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
%
\wxheading{Remark/Warning}
The exact behaviour of wxSocketBase::Read() depends on the combination
-of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
+of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
\wxheading{See also}
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror},
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
%
\wxheading{Remark/Warning}
The exact behaviour of wxSocketBase::Write() depends on the combination
-of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
+of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
\wxheading{See also}
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror},
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
%
\wxheading{Remark/Warning}
-wxSocketBase::WriteMsg() will behave as if the wxSOCKET_WAITALL flag was always set
-and it will always ignore the wxSOCKET_NOWAIT flag. The exact behaviour of WriteMsg
-depends on the wxSOCKET_BLOCK flag. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
+wxSocketBase::WriteMsg() will behave as if the wxSOCKET\_WAITALL flag was always set
+and it will always ignore the wxSOCKET\_NOWAIT flag. The exact behaviour of WriteMsg
+depends on the wxSOCKET\_BLOCK flag. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
\wxheading{See also}
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
-\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror},
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
+\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags},
\helpref{wxSocketBase::ReadMsg}{wxsocketbasereadmsg}
%
\wxheading{Remark/Warning}
-wxSocketBase::ReadMsg() will behave as if the wxSOCKET_WAITALL flag was always set
-and it will always ignore the wxSOCKET_NOWAIT flag. The exact behaviour of ReadMsg
-depends on the wxSOCKET_SPEED flag. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
+wxSocketBase::ReadMsg() will behave as if the wxSOCKET\_WAITALL flag was always set
+and it will always ignore the wxSOCKET\_NOWAIT flag. The exact behaviour of ReadMsg
+depends on the wxSOCKET\_BLOCK flag. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
\wxheading{See also}
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
-\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror},
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
+\helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags},
\helpref{wxSocketBase::WriteMsg}{wxsocketbasewritemsg}
%
\wxheading{See also}
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror},
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
%
\func{wxSocketBase\&}{Discard}{\void}
This function simply deletes all bytes in the incoming queue. This function
-doesn't wait. That is, it will behave as if the wxSOCKET_NOWAIT flag was set. The
-wxSOCKET_SPEED and wxSOCKET_WAITALL flags have no effect on this function.
+doesn't wait. That is, it will behave as if the wxSOCKET\_NOWAIT flag was set. The
+wxSOCKET\_BLOCK and wxSOCKET\_WAITALL flags have no effect on this function.
Use LastCount to see the number of bytes discarded.
\wxheading{See also}
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
-\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
%
\wxheading{See also}
-\helpref{wxSocketBase::Wait}{wxsocketbasewait}\\
-\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::Wait}{wxsocketbasewait},
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
%
\wxheading{See also}
-\helpref{wxSocketBase::Wait}{wxsocketbasewait}\\
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
+\helpref{wxSocketBase::Wait}{wxsocketbasewait},
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
%
\wxheading{See also}
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
-\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
% ---------------------------------------------------------------------------
\func{void}{SaveState}{\void}
This function saves the current state of the socket object in a stack:
-actually it saves all flags (those set with SetFlags, SetNotify, Notfy)
+actually it saves all flags (those set with SetFlags, SetNotify, Notify)
and the state of the asynchronous callbacks (Callback, CallbackData).
Calls to SaveState / RestoreState can be nested.
%
\membersection{wxSocketBase::GetLocal}{wxsocketbasegetlocal}
-\constfunc{bool}{GetLocal}{\param{wxSockAddress\& }{addr_man}}
+\constfunc{bool}{GetLocal}{\param{wxSockAddress\& }{addr\_man}}
This function returns the local address field of the socket. The local
address field contains the complete local address of the socket (local
%
\membersection{wxSocketBase::GetPeer}{wxsocketbasegetlocal}
-\constfunc{bool}{GetPeer}{\param{wxSockAddress\& }{addr_man}}
+\constfunc{bool}{GetPeer}{\param{wxSockAddress\& }{addr\_man}}
This function returns the peer address field of the socket. The peer
address field contains the complete peer host address of the socket
\wxheading{See also}
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
-\helpref{wxSocketBase::Notify}{wxsocketbasenotify}\\
-\helpref{wxSocketEvent}{wxsocketevent}\\
-\helpref{wxEvtHandler}{wxevthandler}\\
-\helpref{wxSocketBase::Callback}{wxsocketbasecallback}\\
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
+\helpref{wxSocketBase::Notify}{wxsocketbasenotify},
+\helpref{wxSocketEvent}{wxsocketevent},
+\helpref{wxEvtHandler}{wxevthandler},
+\helpref{wxSocketBase::Callback}{wxsocketbasecallback},
\helpref{wxSocketBase::CallbackData}{wxsocketbasecallbackdata}
\membersection{wxSocketBase::Callback}\label{wxsocketbasecallback}
The first parameter is a reference to the socket object in which the event
occured. The second parameter tells you which event occured. (See \helpref{wxSocket events}{wxsocketbase}).
-The third parameter is the user data you specified using \helpref{CallbackData}{wxsocketcallbackdata}.
+The third parameter is the user data you specified using \helpref{CallbackData}{wxsocketbasecallbackdata}.
\wxheading{Return value}
\wxheading{See also}
-\helpref{wxSocketBase::CallbackData}{wxsocketbasecallbackdata}\\
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
+\helpref{wxSocketBase::CallbackData}{wxsocketbasecallbackdata},
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
\helpref{wxSocketBase::Notify}{wxsocketbasenotify}
\membersection{wxSocketBase::CallbackData}\label{wxsocketbasecallbackdata}
A pointer to the previous user data.
-\helpref{wxSocketBase::Callback}{wxsocketbasecallback}\\
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
+\helpref{wxSocketBase::Callback}{wxsocketbasecallback},
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
\helpref{wxSocketBase::Notify}{wxsocketbasenotify}
% ---------------------------------------------------------------------------
If {\it 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.
+
{\bf Warning !} This will block the GUI.
If {\it 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)
-
+succesful establishment) and "lost" events (for connection failure).
\wxheading{Parameters}
\wxheading{See also}
-\helpref{wxSocketClient::WaitOnConnect}{wxsocketclientwaitonconnect}\\
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
+\helpref{wxSocketClient::WaitOnConnect}{wxsocketclientwaitonconnect},
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
\helpref{wxSocketBase::Notify}{wxsocketbasenotify}
%
\twocolitem{{\bf EVT\_SOCKET(id, func)}}{Process a socket event, supplying the member function.}
\end{twocollist}%
-[TODO:]
-A brief note on how to use events.
-The wxSOCKET_INPUT event is generated when the
-
\wxheading{See also}
-\helpref{wxSocketBase}{wxsocketbase},\rtfsp
-\helpref{wxSocketClient}{wxsocketclient},\rtfsp
+\helpref{wxSocketBase}{wxsocketbase},
+\helpref{wxSocketClient}{wxsocketclient},
\helpref{wxSocketServer}{wxsocketserver}
\latexignore{\rtfignore{\wxheading{Members}}}
%
% Accept
%
-\membersection{wxSocketServer::Accept}
+\membersection{wxSocketServer::Accept}\label{wxsocketserveraccept}
\func{wxSocketBase *}{Accept}{\param{bool}{ wait = TRUE}}
\wxheading{See also}
-\helpref{wxSocketServer::WaitForAccept}{wxsocketbasewaitforaccept}\\
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
-\helpref{wxSocketBase::Notify}{wxsocketbasenotify}\\
+\helpref{wxSocketServer::WaitForAccept}{wxsocketserverwaitforaccept},
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
+\helpref{wxSocketBase::Notify}{wxsocketbasenotify},
\helpref{wxSocketServer::AcceptWith}{wxsocketserveracceptwith}
%
{\it wait} parameter was FALSE and there were no pending
connections.
-\helpref{wxSocketServer::WaitForAccept}{wxsocketbasewaitforaccept}\\
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
-\helpref{wxSocketBase::Notify}{wxsocketbasenotify}\\
+\helpref{wxSocketServer::WaitForAccept}{wxsocketserverwaitforaccept},
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
+\helpref{wxSocketBase::Notify}{wxsocketbasenotify},
\helpref{wxSocketServer::Accept}{wxsocketserveraccept} for a detailed explanation
-
%
% WaitForAccept
%
\wxheading{See also}
-\helpref{wxSocketServer::Accept}{wxsocketserveraccept}\\
+\helpref{wxSocketServer::Accept}{wxsocketserveraccept},
\helpref{wxSocketServer::AcceptWith}{wxsocketserveracceptwith}
-