]> git.saurik.com Git - wxWidgets.git/commitdiff
Documented Destroy()
authorGuillermo Rodriguez Garcia <guille@iies.es>
Mon, 6 Mar 2000 17:11:10 +0000 (17:11 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Mon, 6 Mar 2000 17:11:10 +0000 (17:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/socket.tex

index 263aeb58f5bcb543644023998b3011729714d521..7f1ce3bbbd4bc8047323a424947f91b720da8199 100644 (file)
@@ -105,7 +105,8 @@ handler macro to direct events to member functions that take a
 \membersection{Construction and destruction}
 
 \helpref{wxSocketBase}{wxsocketbaseconstruct}\\
 \membersection{Construction and destruction}
 
 \helpref{wxSocketBase}{wxsocketbaseconstruct}\\
-\helpref{\destruct{wxSocketBase}}{wxsocketbasedestruct}
+\helpref{\destruct{wxSocketBase}}{wxsocketbasedestruct}\\
+\helpref{wxDestroy}{wxsocketbasedestroy}
 
 \membersection{Socket state}
 
 
 \membersection{Socket state}
 
@@ -186,7 +187,9 @@ Default constructor. Don't use it directly; instead, use
 
 \func{}{\destruct{wxSocketBase}}{\void}
 
 
 \func{}{\destruct{wxSocketBase}}{\void}
 
-Destructor.
+Destructor. Do not destroy a socket using the delete operator directly;
+use \helpref{wxsocketbasedestroy} instead. Also, do not create socket
+objects in the stack.
 
 %
 % Callback
 
 %
 % Callback
@@ -252,8 +255,8 @@ A pointer to the previous user data.
 
 This function shuts down the socket, disabling further transmission and
 reception of data; it also disables events for the socket and frees the
 
 This function shuts down the socket, disabling further transmission and
 reception of data; it also disables events for the socket and frees the
-associated system resources. If you destroy a socket, Close is automatically
-called.
+associated system resources. If you \helpref{Destroy}{wxsocketbasedestroy}
+a socket, Close is automatically called.
 
 \wxheading{Remark/Warning}
 
 
 \wxheading{Remark/Warning}
 
@@ -262,6 +265,22 @@ that event messages may be waiting in the application's event queue. The
 application must therefore be prepared to handle socket event messages
 even after calling Close.
 
 application must therefore be prepared to handle socket event messages
 even after calling Close.
 
+%
+% Discard
+%
+\membersection{wxSocketBase::Destroy}\label{wxsocketbasedestroy}
+
+\func{void}{Destroy}{\void}
+
+Destroys the socket safely. Use this function instead of the delete operator,
+since otherwise socket events could reach the application even after the
+socket has been destroyed. To prevent this problem, this function appends
+the wxSocket to a list of object to be deleted on idle time, after all
+events have been processed. For the same reason, you should avoid creating
+socket objects in the stack.
+
+Destroy calls \helpref{Close}{wxsocketbaseclose} automatically.
+
 %
 % Discard
 %
 %
 % Discard
 %
@@ -401,6 +420,18 @@ will be sent.
 Returns TRUE if the socket is initialized and ready and FALSE in other
 cases.
 
 Returns TRUE if the socket is initialized and ready and FALSE in other
 cases.
 
+\wxheading{Remark/Warning}
+
+For \helpref{wxSocketClient}{wxsocketclient}, Ok won't return TRUE unless
+the client is connected to a server.
+
+For \helpref{wxSocketServer}{wxsocketserver}, Ok will return TRUE if the
+server could bind to the specified address and is already listening for
+new connections.
+
+Ok does not check for IO errors; use \helpref{Error}{wxsocketbaseerror}
+instead for that purpose.
+
 %
 % RestoreState
 %
 %
 % RestoreState
 %