]> git.saurik.com Git - wxWidgets.git/blobdiff - docs/latex/wx/socket.tex
wxSplitPath() bugs corrected and it's documented
[wxWidgets.git] / docs / latex / wx / socket.tex
index 7216280a3a4ab964cdbff3ed50920a87e782de0f..49a59bb2275f5e27e089d1668bbc471114ee2270 100644 (file)
@@ -4,6 +4,10 @@
 
 \helpref{wxEvtHandler}{wxevthandler}
 
+\wxheading{Include files}
+
+<wx/socket.h>
+
 % ---------------------------------------------------------------------------
 % Event handling
 % ---------------------------------------------------------------------------
@@ -23,7 +27,9 @@ functions that take a \helpref{wxSocketEvent}{wxsocketevent} argument.
 % ---------------------------------------------------------------------------
 \wxheading{See also}
 
-\helpref{wxSocketEvent}{wxsocketevent}, \helpref{wxSocketClient}{wxsocketclient}, \helpref{wxSocketServer}{wxsocketserver}
+\helpref{wxSocketEvent}{wxsocketevent}\\
+\helpref{wxSocketClient}{wxsocketclient}\\
+\helpref{wxSocketServer}{wxsocketserver}
 
 % ---------------------------------------------------------------------------
 % Members
@@ -121,9 +127,9 @@ Returns a reference to the current object.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Error}{wxsocketbaseerror},
- \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
- \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
+\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
 
 %
 % Read
@@ -144,6 +150,20 @@ This function reads a buffer of {\it nbytes} bytes from the socket.
 
 Returns a reference to the current object.
 
+\wxheading{Remark/Warning}
+
+By default, Read uses an internal asynchronous manager: it will send data when
+the socket requests them. It is particularly interesting when you enter a long
+data transfer (e.g. a big file, an image, ...). But it is also buggy when you
+simply discuss with the peer using user data. In this case, wxSocket prepares
+itself to send data (Write wait for them to be sent) and during a GUI refresh
+the user enters new data, which involves a new Read call though the previous
+isn't finished. Well, in most cases it can work but it might fail too.
+So I advise you to use the SPEED flag, which disables the asynchronous manager,
+when you just want to discuss with the peer.
+
+This remark is also valid for all IO call.
+
 \wxheading{See also}
 
 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
@@ -154,7 +174,13 @@ Returns a reference to the current object.
 
 \func{void}{SetFlags}{\param{wxSockFlags}{ flags}}
 
-TODO
+\twocolwidtha{7cm}
+\begin{twocollist}\itemsep=0pt
+\twocolitem{{\bf wxSocketBase::NONE}}{Normal functionnalities.}
+\twocolitem{{\bf wxSocketBase::NOWAIT}}{Get the available data in the input queue and exit immediately.}
+\twocolitem{{\bf wxSocketBase::WAITALL}}{Wait for all required data unless an error occured.}
+\twocolitem{{\bf wxSocketBase::SPEED}}{Disable the asynchronous IO functionnality.}
+\end{twocollist}
 
 %
 % Read
@@ -165,6 +191,18 @@ TODO
 
 This function writes a buffer of {\it nbytes} bytes from the socket.
 
+\wxheading{Remark/Warning}
+
+By default, Write uses an internal asynchronous manager: it will send data when
+the socket requests them. It is particularly interesting when you enter a long
+data transfer (e.g. a big file, an image, ...). But it is also buggy when you
+simply discuss with the peer using user data. In this case, wxSocket prepares
+itself to send data (Write wait for them to be sent) and during a GUI refresh
+the user enters new data, which involves a new Write call though the previous
+isn't finished. Well, in most cases it can work but it might fail too.  
+So I advise you to use the SPEED flag, which disables the asynchronous manager,
+when you just want to discuss with the peer.
+
 \wxheading{Parameters}
 
 \docparam{buffer}{Buffer where to get the data to write.}
@@ -177,9 +215,9 @@ Returns a reference to the current object.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Error}{wxsocketbaseerror},
- \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
- \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
+\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
 
 %
 % WriteMsg
@@ -204,10 +242,10 @@ Returns a reference to the current object.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Error}{wxsocketbaseerror},
- \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
- \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
- \helpref{wxSocketBase::ReadMsg}{wxsocketbasereadmsg}
+\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
+\helpref{wxSocketBase::ReadMsg}{wxsocketbasereadmsg}
 
 %
 % ReadMsg
@@ -232,10 +270,10 @@ Returns a reference to the current object.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Error}{wxsocketbaseerror},
- \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
- \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
- \helpref{wxSocketBase::WriteMsg}{wxsocketbasewritemsg}
+\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}\\
+\helpref{wxSocketBase::WriteMsg}{wxsocketbasewritemsg}
 
 %
 % Unread
@@ -260,9 +298,9 @@ Returns a reference to the current object.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Error}{wxsocketbaseerror},
- \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
- \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
+\helpref{wxSocketBase::Error}{wxsocketbaseerror}\\
+\helpref{wxSocketBase::LastCount}{wxsocketbaselastcount}\\
+\helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
 
 %
 % Discard
@@ -297,9 +335,9 @@ 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::WaitForLost}{wxsocketbasewaitforlost}
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
 % WaitForRead
@@ -322,9 +360,9 @@ Returns TRUE if a byte arrived, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Wait}{wxsocketbasewait},
- \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
- \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
+\helpref{wxSocketBase::Wait}{wxsocketbasewait}\\
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
 % WaitForWrite
@@ -347,9 +385,9 @@ Returns TRUE if a write event occured, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::Wait}{wxsocketbasewait},
- \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
- \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
+\helpref{wxSocketBase::Wait}{wxsocketbasewait}\\
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
+\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
 % WaitForLost
@@ -373,9 +411,9 @@ Returns TRUE if a "lost" event occured, FALSE if the timeout was reached.
 
 \wxheading{See also}
 
-\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
- \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
- \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
+\helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread}\\
+\helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite}\\
+\helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
 
 %
 % RestoreState
@@ -435,6 +473,10 @@ Sets an event handler to be called when a socket event occured.
 
 \helpref{wxSocketBase}{wxsocketbase}
 
+\wxheading{Include files}
+
+<wx/socket.h>
+
 % ---------------------------------------------------------------------------
 % Members
 % ---------------------------------------------------------------------------
@@ -447,7 +489,7 @@ Sets an event handler to be called when a socket event occured.
 
 Constructs a new wxSocketClient.
 
-{\bf Warning !} The created socket client needs to be registered to a socket handler (See \helpref{wxSocketHandler}{wxsockethandler}).
+{\bf Warning !} The new socket client needs to be registered to a socket handler (See \helpref{wxSocketHandler}{wxsockethandler}).
 
 \wxheading{Parameters}
 
@@ -460,7 +502,7 @@ Constructs a new wxSocketClient.
 
 \func{}{\destruct{wxSocketClient}}{\void}
 
-Destructs a wxSocketClient object.
+Destroys a wxSocketClient object.
 
 %
 % Connect
@@ -510,6 +552,10 @@ This event class contains information about socket events.
 
 \helpref{wxEvent}{wxevent}
 
+\wxheading{Include files}
+
+<wx/socket.h>
+
 \wxheading{Event table macros}
 
 To process a socket event, use these event handler macros to direct input to member
@@ -550,6 +596,10 @@ Returns the socket event type.
 
 \helpref{wxObject}{wxobject}
 
+\wxheading{Include files}
+
+<wx/socket.h>
+
 % ---------------------------------------------------------------------------
 % Members
 % ---------------------------------------------------------------------------
@@ -575,7 +625,7 @@ many sockets.
 
 \func{}{\destruct{wxSocketHandler}}{\void}
 
-Destructs a wxSocketHandler object.
+Destroys a wxSocketHandler object.
 
 %
 % Register
@@ -689,6 +739,7 @@ Returns 0 if a timeout occured, else the number of events detected.
 \func{void}{YieldSock}{\void}
 
 Execute pending requests in all registered sockets.
+
 % ---------------------------------------------------------------------------
 % CLASS: wxSocketServer
 % ---------------------------------------------------------------------------
@@ -698,6 +749,10 @@ Execute pending requests in all registered sockets.
 
 \helpref{wxSocketBase}{wxsocketbase}
 
+\wxheading{Include files}
+
+<wx/socket.h>
+
 % ---------------------------------------------------------------------------
 % Members
 % ---------------------------------------------------------------------------
@@ -728,7 +783,7 @@ Constructs a new wxSocketServer.
 
 \func{}{\destruct{wxSocketServer}}{\void}
 
-Destructs a wxSocketServer object (it doesn't close the accepted connection).
+Destroys a wxSocketServer object (it doesn't close the accepted connection).
 
 %
 % Accept
@@ -765,4 +820,3 @@ This is useful when someone wants to inherit wxSocketBase.
 
 Returns TRUE if no error occurs, else FALSE.
 
-