]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/socket.tex
EnableTool() should be called after Realize()
[wxWidgets.git] / docs / latex / wx / socket.tex
index 4e67a9352b81c628600ead34a0127da18a79c4be..68490521f6fb50eef8b926f52c26e59428a82a52 100644 (file)
@@ -8,7 +8,7 @@
 
 <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
@@ -72,8 +72,8 @@ input to member functions that take a \helpref{wxSocketEvent}{wxsocketevent} arg
 % ---------------------------------------------------------------------------
 \wxheading{See also}
 
-\helpref{wxSocketEvent}{wxsocketevent}\\
-\helpref{wxSocketClient}{wxsocketclient}\\
+\helpref{wxSocketEvent}{wxsocketevent}
+\helpref{wxSocketClient}{wxsocketclient}
 \helpref{wxSocketServer}{wxsocketserver}
 
 % ---------------------------------------------------------------------------
@@ -85,7 +85,7 @@ input to member functions that take a \helpref{wxSocketEvent}{wxsocketevent} arg
 
 \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}}
@@ -111,7 +111,7 @@ Destroys the wxSocketBase object.
 \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.
@@ -138,19 +138,22 @@ recv() or send() as needed so as to transfer all the data. Note that
 "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
@@ -172,9 +175,11 @@ following flags can be used:
 \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.
 
@@ -183,7 +188,7 @@ For more information on socket events see \helpref{wxSocket events}{wxsocketbase
 %
 % SetTimeout
 %
-\membersection{wxSocketBase::SetTimeout}{wxsocketbasesettimeout}
+\membersection{wxSocketBase::SetTimeout}\label{wxsocketbasesettimeout}
 
 \func{void}{SetTimeout}{\param{int }{seconds}}
 
@@ -302,9 +307,9 @@ of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetF
 
 \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}
 
 %
@@ -333,13 +338,13 @@ Returns a reference to the current object.
 \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}
 
 %
@@ -368,13 +373,13 @@ Returns a reference to the current object.
 \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}
 
 %
@@ -406,16 +411,16 @@ Returns a reference to the current object.
 
 \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}
 
 %
@@ -445,16 +450,16 @@ Returns a reference to the current object.
 
 \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}
 
 %
@@ -483,8 +488,8 @@ Returns a reference to the current object.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
-\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::Error}{wxsocketbaseerror}
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}
 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
 
 %
@@ -495,8 +500,8 @@ Returns a reference to the current object.
 \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.
 
@@ -526,8 +531,8 @@ Returns TRUE if an event occured, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
-\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}
 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
@@ -551,8 +556,8 @@ Returns TRUE if there is data to be read, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Wait}{wxsocketbasewait}\\
-\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::Wait}{wxsocketbasewait}
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}
 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
@@ -576,8 +581,8 @@ Returns TRUE if you can write to the socket, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Wait}{wxsocketbasewait}\\
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
+\helpref{wxSocketBase::Wait}{wxsocketbasewait}
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}
 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
@@ -602,8 +607,8 @@ Returns TRUE if the connection was lost, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
-\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}
 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 % ---------------------------------------------------------------------------
@@ -634,7 +639,7 @@ Calls to SaveState / RestoreState can be nested.
 \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.
@@ -648,7 +653,7 @@ 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
@@ -663,7 +668,7 @@ It returns TRUE if no errors happened, FALSE otherwise.
 %
 \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
@@ -695,11 +700,11 @@ Callback and CallbackData.
 
 \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}
@@ -716,7 +721,7 @@ void SocketCallback(wxSocketBase& sock,wxSocketNotify evt,char *cdata);
 
 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}
 
@@ -724,8 +729,8 @@ A pointer to the previous callback.
 
 \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}
@@ -738,8 +743,8 @@ This function sets the the user data which will be passed to a \helpref{C callba
 
 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}
 
 % ---------------------------------------------------------------------------
@@ -791,14 +796,14 @@ Connects to a server using the specified address.
 
 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}
 
@@ -819,8 +824,8 @@ with WaitOnConnect or by watching "connection" and "lost" events.
 
 \wxheading{See also}
 
-\helpref{wxSocketClient::WaitOnConnect}{wxsocketclientwaitonconnect}\\
-\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}\\
+\helpref{wxSocketClient::WaitOnConnect}{wxsocketclientwaitonconnect}
+\helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify}
 \helpref{wxSocketBase::Notify}{wxsocketbasenotify}
 
 %
@@ -874,14 +879,10 @@ functions that take a wxSocketEvent argument.
 \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}}}
@@ -943,7 +944,7 @@ Destroys a wxSocketServer object (it doesn't close the accepted connections).
 %
 % Accept
 %
-\membersection{wxSocketServer::Accept}
+\membersection{wxSocketServer::Accept}\label{wxsocketserveraccept}
 
 \func{wxSocketBase *}{Accept}{\param{bool}{ wait = TRUE}}
 
@@ -968,9 +969,9 @@ connections.
 
 \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}
 
 %
@@ -993,12 +994,11 @@ Returns TRUE on success, or FALSE if an error occured or if the
 {\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
 %
@@ -1022,7 +1022,6 @@ Returns TRUE if an incoming connection arrived, FALSE if the timeout expired.
 
 \wxheading{See also}
 
-\helpref{wxSocketServer::Accept}{wxsocketserveraccept}\\
+\helpref{wxSocketServer::Accept}{wxsocketserveraccept}
 \helpref{wxSocketServer::AcceptWith}{wxsocketserveracceptwith}
 
-