]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/socket.tex
Ops
[wxWidgets.git] / docs / latex / wx / socket.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: socket.tex
3 %% Purpose: wxSocket docs
4 %% Author: Guillermo Rodriguez Garcia <guille@iies.es>
5 %% Modified by:
6 %% Created: 1999
7 %% RCS-ID: $Id$
8 %% Copyright: (c) wxWindows team
9 %% Licence: wxWindows licence
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 \section{\class{wxSocketBase}}\label{wxsocketbase}
13
14 wxSocketBase is the base class for all socket-related objects, and it
15 defines all basic IO functionality.
16
17 \wxheading{Derived from}
18
19 \helpref{wxEvtHandler}{wxevthandler}
20
21 \wxheading{Include files}
22
23 <wx/socket.h>
24
25 \wxheading{wxSocket errors}
26
27 \twocolwidtha{7cm}
28 \begin{twocollist}\itemsep=0pt
29 \twocolitem{{\bf wxSOCKET\_NOERROR}}{No error happened.}
30 \twocolitem{{\bf wxSOCKET\_INVOP}}{Invalid operation.}
31 \twocolitem{{\bf wxSOCKET\_IOERR}}{Input/Output error.}
32 \twocolitem{{\bf wxSOCKET\_INVADDR}}{Invalid address passed to wxSocket.}
33 \twocolitem{{\bf wxSOCKET\_INVSOCK}}{Invalid socket (uninitialized).}
34 \twocolitem{{\bf wxSOCKET\_NOHOST}}{No corresponding host.}
35 \twocolitem{{\bf wxSOCKET\_INVPORT}}{Invalid port.}
36 \twocolitem{{\bf wxSOCKET\_WOULDBLOCK}}{The socket is non-blocking and the operation would block.}
37 \twocolitem{{\bf wxSOCKET\_TIMEDOUT}}{The timeout for this operation expired.}
38 \twocolitem{{\bf wxSOCKET\_MEMERR}}{Memory exhausted.}
39 \end{twocollist}
40
41 \wxheading{wxSocket events}
42
43 \twocolwidtha{7cm}
44 \begin{twocollist}\itemsep=0pt
45 \twocolitem{{\bf wxSOCKET\_INPUT}}{There is data available for reading.}
46 \twocolitem{{\bf wxSOCKET\_OUTPUT}}{The socket is ready to be written to.}
47 \twocolitem{{\bf wxSOCKET\_CONNECTION}}{Incoming connection (server), or connection establishment (client).}
48 \twocolitem{{\bf wxSOCKET\_LOST}}{The connection has been closed.}
49 \end{twocollist}
50
51 A brief note on how to use these events:
52
53 The {\bf wxSOCKET\_INPUT} event will be issued whenever there is data
54 available for reading. This will be the case if the input queue was
55 empty and new data arrives, or if the application has read some data
56 yet there is still more data available. This means that the application
57 does not need to read all available data in response to a
58 {\bf wxSOCKET\_INPUT} event, as more events will be produced as
59 necessary.
60
61 The {\bf wxSOCKET\_OUTPUT} event is issued when a socket is first
62 connected with \helpref{Connect}{wxsocketclientconnect} or accepted
63 with \helpref{Accept}{wxsocketserveraccept}. After that, new
64 events will be generated only after an output operation fails
65 with {\bf wxSOCKET\_WOULDBLOCK} and buffer space becomes available
66 again. This means that the application should assume that it
67 can write data to the socket until an {\bf wxSOCKET\_WOULDBLOCK}
68 error occurs; after this, whenever the socket becomes writable
69 again the application will be notified with another
70 {\bf wxSOCKET\_OUTPUT} event.
71
72 The {\bf wxSOCKET\_CONNECTION} event is issued when a delayed connection
73 request completes succesfully (client) or when a new connection arrives
74 at the incoming queue (server).
75
76 The {\bf wxSOCKET\_LOST} event is issued when a close indication is
77 received for the socket. This means that the connection broke down or
78 that it was closed by the peer. Also, this event will be issued if
79 a delayed connection request fails.
80
81 \wxheading{Event handling}
82
83 To process events coming from a socket object, use the following event
84 handler macro to direct events to member functions that take a
85 \helpref{wxSocketEvent}{wxsocketevent} argument.
86
87 \twocolwidtha{7cm}%
88 \begin{twocollist}\itemsep=0pt
89 \twocolitem{{\bf EVT\_SOCKET(id, func)}}{Process a wxEVT\_SOCKET event.}
90 \end{twocollist}
91
92 \wxheading{See also}
93
94 \helpref{wxSocketEvent}{wxsocketevent},
95 \helpref{wxSocketClient}{wxsocketclient},
96 \helpref{wxSocketServer}{wxsocketserver},
97 \helpref{Sockets sample}{samplesockets}
98
99 % ---------------------------------------------------------------------------
100 % Function groups
101 % ---------------------------------------------------------------------------
102
103 \latexignore{\rtfignore{\wxheading{Function groups}}}
104
105 \membersection{Construction and destruction}
106
107 \helpref{wxSocketBase}{wxsocketbaseconstruct}\\
108 \helpref{\destruct{wxSocketBase}}{wxsocketbasedestruct}
109
110 \membersection{Socket state}
111
112 Functions to retrieve current state and miscellaneous info.
113
114 \helpref{Error}{wxsocketbaseerror}\\
115 \helpref{GetLocal}{wxsocketbasegetlocal}\\
116 \helpref{GetPeer}{wxsocketbasegetpeer}
117 \helpref{IsConnected}{wxsocketbaseisconnected}\\
118 \helpref{IsData}{wxsocketbaseisdata}\\
119 \helpref{IsDisconnected}{wxsocketbaseisdisconnected}\\
120 \helpref{LastCount}{wxsocketbaselastcount}\\
121 \helpref{LastError}{wxsocketbaselasterror}\\
122 \helpref{Ok}{wxsocketbaseok}\\
123 \helpref{SaveState}{wxsocketbasesavestate}\\
124 \helpref{RestoreState}{wxsocketbaserestorestate}
125
126 \membersection{Basic IO}
127
128 Functions that perform basic IO functionality.
129
130 \helpref{Close}{wxsocketbaseclose}\\
131 \helpref{Discard}{wxsocketbasediscard}\\
132 \helpref{Peek}{wxsocketbasepeek}\\
133 \helpref{Read}{wxsocketbaseread}\\
134 \helpref{ReadMsg}{wxsocketbasereadmsg}\\
135 \helpref{Unread}{wxsocketbaseunread}\\
136 \helpref{Write}{wxsocketbasewrite}\\
137 \helpref{WriteMsg}{wxsocketbasewritemsg}
138
139 Functions that perform a timed wait on a certain IO condition.
140
141 \helpref{Wait}{wxsocketbasewait}\\
142 \helpref{WaitForRead}{wxsocketbasewaitforread}\\
143 \helpref{WaitForWrite}{wxsocketbasewaitforwrite}\\
144 \helpref{WaitForLost}{wxsocketbasewaitforlost}
145
146 Functions that allow applications to customize socket IO as needed.
147
148 \helpref{SetFlags}{wxsocketbasesetflags}\\
149 \helpref{SetTimeout}{wxsocketbasesettimeout}
150
151 \membersection{Handling socket events}
152
153 Functions that allow applications to receive socket events.
154
155 \helpref{Notify}{wxsocketbasenotify}\\
156 \helpref{SetNotify}{wxsocketbasesetnotify}\\
157 \helpref{SetEventHandler}{wxsocketbaseseteventhandler}
158
159 Callback functions are also available, but they are provided for backwards
160 compatibility only. Their use is discouraged in favour of events, and should
161 be considered deprecated.
162
163 \helpref{Callback}{wxsocketbasecallback}\\
164 \helpref{CallbackData}{wxsocketbasecallbackdata}
165
166
167 % ---------------------------------------------------------------------------
168 % Members here
169 % ---------------------------------------------------------------------------
170
171 \helponly{\insertatlevel{2}{
172
173 \wxheading{Members}
174
175 }}
176
177 \membersection{wxSocketBase::wxSocketBase}\label{wxsocketbaseconstruct}
178
179 \func{}{wxSocketBase}{\void}
180
181 Default constructor. Don't use it directly; instead, use
182 \helpref{wxSocketClient}{wxsocketclient} to construct a socket client, or
183 \helpref{wxSocketServer}{wxsocketserver} to construct a socket server.
184
185 \membersection{wxSocketBase::\destruct{wxSocketBase}}\label{wxsocketbasedestruct}
186
187 \func{}{\destruct{wxSocketBase}}{\void}
188
189 Destructor.
190
191 %
192 % Callback
193 %
194 \membersection{wxSocketBase::Callback}\label{wxsocketbasecallback}
195
196 \func{wxSocketBase::wxSockCbk}{Callback}{\param{wxSocketBase::wxSockCbk}{ callback}}
197
198 You can setup a callback function to be called when an event occurs.
199 The function will be called only for those events for which notification
200 has been enabled with \helpref{Notify}{wxsocketbasenotify} and
201 \helpref{SetNotify}{wxsocketbasesetnotify}. The prototype of the
202 callback must be as follows:
203
204 \begin{verbatim}
205 void SocketCallback(wxSocketBase& sock, wxSocketNotify evt, char *cdata);
206 \end{verbatim}
207
208 The first parameter is a reference to the socket object in which the
209 event occured. The second parameter tells you which event occured.
210 (See \helpref{wxSocket events}{wxsocketbase}). The third parameter
211 is the user data you specified using
212 \helpref{CallbackData}{wxsocketbasecallbackdata}.
213
214 Note that events are preferred over callbacks where possible.
215
216 \wxheading{Return value}
217
218 A pointer to the previous callback.
219
220 \wxheading{See also}
221
222 \helpref{wxSocketBase::CallbackData}{wxsocketbasecallbackdata},
223 \helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
224 \helpref{wxSocketBase::Notify}{wxsocketbasenotify}
225
226 %
227 % CallbackData
228 %
229 \membersection{wxSocketBase::CallbackData}\label{wxsocketbasecallbackdata}
230
231 \func{char *}{CallbackData}{\param{char *}{cdata}}
232
233 This function sets the the user data which will be passed to a
234 callback function set via \helpref{Callback}{wxsocketbasecallback}.
235
236 Note that events are preferred over callbacks where possible.
237
238 \wxheading{Return value}
239
240 A pointer to the previous user data.
241
242 \helpref{wxSocketBase::Callback}{wxsocketbasecallback},
243 \helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
244 \helpref{wxSocketBase::Notify}{wxsocketbasenotify}
245
246 %
247 % Close
248 %
249 \membersection{wxSocketBase::Close}\label{wxsocketbaseclose}
250
251 \func{void}{Close}{\void}
252
253 This function shuts down the socket, disabling further transmission and
254 reception of data; it also disables events for the socket and frees the
255 associated system resources. If you destroy a socket, Close is automatically
256 called.
257
258 \wxheading{Remark/Warning}
259
260 Although Close immediately disables events for the socket, it is possible
261 that event messages may be waiting in the application's event queue. The
262 application must therefore be prepared to handle socket event messages
263 even after calling Close.
264
265 %
266 % Discard
267 %
268 \membersection{wxSocketBase::Discard}\label{wxsocketbasediscard}
269
270 \func{wxSocketBase\&}{Discard}{\void}
271
272 This function simply deletes all bytes in the incoming queue. This function
273 always returns immediately and its operation is not affected by IO flags.
274
275 Use \helpref{LastCount}{wxsocketbaselastcount} to verify the number of bytes actually discarded.
276
277 If you use \helpref{Error}{wxsocketbaseerror}, it will always return FALSE.
278
279 %
280 % Error
281 %
282 \membersection{wxSocketBase::Error}\label{wxsocketbaseerror}
283
284 \constfunc{bool}{Error}{\void}
285
286 Returns TRUE if an error occured in the last IO operation.
287
288 Use this function to check for an error condition after one of the
289 following calls: Discard, Peek, Read, ReadMsg, Unread, Write, WriteMsg.
290
291 %
292 % GetLocal
293 %
294 \membersection{wxSocketBase::GetLocal}\label{wxsocketbasegetlocal}
295
296 \constfunc{bool}{GetLocal}{\param{wxSockAddress\& }{addr\_man}}
297
298 This function returns the local address field of the socket. The local
299 address field contains the complete local address of the socket (local
300 address, local port, ...).
301
302 \wxheading{Return value}
303
304 It returns TRUE if no errors happened, FALSE otherwise.
305
306 %
307 % GetPeer
308 %
309 \membersection{wxSocketBase::GetPeer}\label{wxsocketbasegetpeer}
310
311 \constfunc{bool}{GetPeer}{\param{wxSockAddress\& }{addr\_man}}
312
313 This function returns the peer address field of the socket. The peer
314 address field contains the complete peer host address of the socket
315 (address, port, ...).
316
317 \wxheading{Return value}
318
319 It returns TRUE if no errors happened, FALSE otherwise.
320
321 %
322 % IsConnected
323 %
324 \membersection{wxSocketBase::IsConnected}\label{wxsocketbaseisconnected}
325
326 \constfunc{bool}{IsConnected}{\void}
327
328 Returns TRUE if the socket is connected.
329
330 %
331 % IsData
332 %
333 \membersection{wxSocketBase::IsData}\label{wxsocketbaseisdata}
334
335 \constfunc{bool}{IsData}{\void}
336
337 This function waits until the socket is readable. This might mean that
338 queued data is available for reading or, for streamed sockets, that
339 the connection has been closed, so that a read operation will complete
340 immediately without blocking (unless the {\bf wxSOCKET\_WAITALL} flag
341 is set, in which case the operation might still block).
342
343 \membersection{wxSocketBase::IsDisconnected}\label{wxsocketbaseisdisconnected}
344
345 %
346 % IsDisconnected
347 %
348 \constfunc{bool}{IsDisconnected}{\void}
349
350 Returns TRUE if the socket is not connected.
351
352 \membersection{wxSocketBase::LastCount}\label{wxsocketbaselastcount}
353
354 %
355 % LastCount
356 %
357 \constfunc{wxUint32}{LastCount}{\void}
358
359 Returns the number of bytes read or written by the last IO call.
360
361 Use this function to get the number of bytes actually transferred
362 after using one of the following IO calls: Discard, Peek, Read,
363 ReadMsg, Unread, Write, WriteMsg.
364
365 %
366 % LastError
367 %
368 \membersection{wxSocketBase::LastError}\label{wxsocketbaselasterror}
369
370 \constfunc{wxSocketError}{LastError}{\void}
371
372 Returns the last wxSocket error. See \helpref{wxSocket errors}{wxsocketbase}.
373
374 Please note that this function merely returns the last error code,
375 but it should not be used to determine if an error has occured (this
376 is because successful operations do not change the LastError value).
377 Use \helpref{Error}{wxsocketbaseerror} first, in order to determine
378 if the last IO call failed. If this returns TRUE, use LastError
379 to discover the cause of the error.
380
381 %
382 % Notify
383 %
384 \membersection{wxSocketBase::Notify}\label{wxsocketbasenotify}
385
386 \func{void}{Notify}{\param{bool}{ notify}}
387
388 According to the {\it notify} value, this function enables
389 or disables socket events. If {\it notify} is TRUE, the events
390 configured with \helpref{SetNotify}{wxsocketbasesetnotify} will
391 be sent to the application. If {\it notify} is FALSE; no events
392 will be sent.
393
394 %
395 % Ok
396 %
397 \membersection{wxSocketBase::Ok}\label{wxsocketbaseok}
398
399 \constfunc{bool}{Ok}{\void}
400
401 Returns TRUE if the socket is initialized and ready and FALSE in other
402 cases.
403
404 %
405 % RestoreState
406 %
407 \membersection{wxSocketBase::RestoreState}\label{wxsocketbaserestorestate}
408
409 \func{void}{RestoreState}{\void}
410
411 This function restores the previous state of the socket, as saved
412 with \helpref{SaveState}{wxsocketbasesavestate}
413
414 Calls to SaveState and RestoreState can be nested.
415
416 \wxheading{See also}
417
418 \helpref{wxSocketBase::SaveState}{wxsocketbasesavestate}
419
420 %
421 % SaveState
422 %
423 \membersection{wxSocketBase::SaveState}\label{wxsocketbasesavestate}
424
425 \func{void}{SaveState}{\void}
426
427 This function saves the current state of the socket in a stack. Socket
428 state includes flags, as set with \helpref{SetFlags}{wxsocketbasesetflags},
429 event mask, as set with \helpref{SetNotify}{wxsocketbasesetnotify} and
430 \helpref{Notify}{wxsocketbasenotify}, and current settings for the
431 asynchronous callbacks, as set with \helpref{Callback}{wxsocketbasecallback}
432 and \helpref{CallbackData}{wxsocketbasecallbackdata}.
433
434 Calls to SaveState and RestoreState can be nested.
435
436 \wxheading{See also}
437
438 \helpref{wxSocketBase::RestoreState}{wxsocketbaserestorestate}
439
440 %
441 % SetEventHandler
442 %
443 \membersection{wxSocketBase::SetEventHandler}\label{wxsocketbaseseteventhandler}
444
445 \func{void}{SetEventHandler}{\param{wxEvtHandler\&}{ evt\_hdlr}, \param{int}{ id = -1}}
446
447 Sets an event handler to be called when a socket event occurs. The
448 handler will be called for those events for which notification is
449 enabled with \helpref{SetNotify}{wxsocketbasesetnotify} and
450 \helpref{Notify}{wxsocketbasenotify}.
451
452 You can also specify a callback function to be called when an event
453 occurs, although if possible, events should be used instead of callbacks.
454 See \helpref{Callback}{wxsocketbasecallback} and
455 \helpref{CallbackData}{wxsocketbasecallbackdata}.
456
457 \wxheading{Parameters}
458
459 \docparam{evt\_hdlr}{Specifies the event handler you want to use.}
460
461 \docparam{id}{The id of socket event.}
462
463 \wxheading{See also}
464
465 \helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
466 \helpref{wxSocketBase::Notify}{wxsocketbasenotify},
467 \helpref{wxSocketEvent}{wxsocketevent},
468 \helpref{wxEvtHandler}{wxevthandler},
469 \helpref{wxSocketBase::Callback}{wxsocketbasecallback},
470 \helpref{wxSocketBase::CallbackData}{wxsocketbasecallbackdata}
471
472 %
473 % SetFlags
474 %
475 \membersection{wxSocketBase::SetFlags}\label{wxsocketbasesetflags}
476
477 \func{void}{SetFlags}{\param{wxSocketBase::wxSockFlags}{ flags}}
478
479 \twocolwidtha{7cm}
480 \begin{twocollist}\itemsep=0pt
481 \twocolitem{{\bf wxSOCKET\_NONE}}{Normal functionality.}
482 \twocolitem{{\bf wxSOCKET\_NOWAIT}}{Read/write as much data as possible and return immediately.}
483 \twocolitem{{\bf wxSOCKET\_WAITALL}}{Wait for all required data to be read/written unless an error occurs.}
484 \twocolitem{{\bf wxSOCKET\_BLOCK}}{Block the GUI (do not yield) while reading/writing data.}
485 \end{twocollist}
486
487 A brief overview on how to use these flags follows.
488
489 If no flag is specified (this is the same as {\bf wxSOCKET\_NONE}),
490 IO calls will return after some data has been read or written, even
491 when the transfer might not be complete. This is the same as issuing
492 exactly one blocking low-level call to recv() or send(). Note that
493 {\it blocking} here refers to when the function returns, not to whether
494 the GUI blocks during this time.
495
496 If {\bf wxSOCKET\_NOWAIT} is specified, IO calls will return immediately.
497 Read operations will retrieve only available data. Write operations will
498 write as much data as possible, depending on how much space is available
499 in the output buffer. This is the same as issuing exactly one nonblocking
500 low-level call to recv() or send(). Note that {\it nonblocking} here
501 refers to when the function returns, not to whether the GUI blocks during
502 this time.
503
504 If {\bf wxSOCKET\_WAITALL} is specified, IO calls won't return until ALL
505 the data has been read or written (or until an error occurs), blocking if
506 necessary, and issuing several low level calls if necessary. This is the
507 same as having a loop which makes as many blocking low-level calls to
508 recv() or send() as needed so as to transfer all the data. Note that
509 {\it blocking} here refers to when the function returns, not to whether
510 the GUI blocks during this time.
511
512 The {\bf wxSOCKET\_BLOCK} flag controls whether the GUI blocks during
513 IO operations. If this flag is specified, the socket will not yield
514 during IO calls, so the GUI will remain blocked until the operation
515 completes. If it is not used, then the application must take extra
516 care to avoid unwanted reentrance.
517
518 So:
519
520 {\bf wxSOCKET\_NONE} will try to read at least SOME data, no matter how much.
521
522 {\bf wxSOCKET\_NOWAIT} will always return immediately, even if it cannot
523 read or write ANY data.
524
525 {\bf wxSOCKET\_WAITALL} will only return when it has read or written ALL
526 the data.
527
528 {\bf wxSOCKET\_BLOCK} has nothing to do with the previous flags and
529 it controls whether the GUI blocks.
530
531 %
532 % SetNotify
533 %
534 \membersection{wxSocketBase::SetNotify}\label{wxsocketbasesetnotify}
535
536 \func{void}{SetNotify}{\param{wxSocketEventFlags}{ flags}}
537
538 SetNotify specifies which socket events are to be sent to the event handler.
539 The {\it flags} parameter is a combination of flags ORed toghether. The
540 following flags can be used:
541
542 \twocolwidtha{7cm}
543 \begin{twocollist}\itemsep=0pt
544 \twocolitem{{\bf wxSOCKET\_INPUT\_FLAG}}{to receive wxSOCKET\_INPUT}
545 \twocolitem{{\bf wxSOCKET\_OUTPUT\_FLAG}}{to receive wxSOCKET\_OUTPUT}
546 \twocolitem{{\bf wxSOCKET\_CONNECTION\_FLAG}}{to receive wxSOCKET\_CONNECTION}
547 \twocolitem{{\bf wxSOCKET\_LOST\_FLAG}}{to receive wxSOCKET\_LOST}
548 \end{twocollist}
549
550 For example:
551
552 \begin{verbatim}
553 sock.SetNotify(wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG);
554 sock.Notify(TRUE);
555 \end{verbatim}
556
557 In this example, the user will be notified about incoming socket data and
558 whenever the connection is closed.
559
560 For more information on socket events see \helpref{wxSocket events}{wxsocketbase}.
561
562 %
563 % SetTimeout
564 %
565 \membersection{wxSocketBase::SetTimeout}\label{wxsocketbasesettimeout}
566
567 \func{void}{SetTimeout}{\param{int }{seconds}}
568
569 This function sets the default socket timeout in seconds. This timeout
570 applies to all IO calls, and also to the \helpref{Wait}{wxsocketbasewait}
571 family of functions if you don't specify a wait interval. Initially, the
572 default is set to 10 minutes.
573
574 %
575 % Peek
576 %
577 \membersection{wxSocketBase::Peek}\label{wxsocketbasepeek}
578
579 \func{wxSocketBase\&}{Peek}{\param{char *}{ buffer}, \param{wxUint32}{ nbytes}}
580
581 This function peeks a buffer of {\it nbytes} bytes from the socket.
582 Peeking a buffer doesn't delete it from the socket input queue.
583
584 Use \helpref{LastCount}{wxsocketbaselastcount} to verify the number of bytes actually peeked.
585
586 Use \helpref{Error}{wxsocketbaseerror} to determine if the operation succeeded.
587
588 \wxheading{Parameters}
589
590 \docparam{buffer}{Buffer where to put peeked data.}
591
592 \docparam{nbytes}{Number of bytes.}
593
594 \wxheading{Return value}
595
596 Returns a reference to the current object.
597
598 \wxheading{Remark/Warning}
599
600 The exact behaviour of wxSocketBase::Peek depends on the combination
601 of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
602
603 \wxheading{See also}
604
605 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
606 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
607 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
608 \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
609
610 %
611 % Read
612 %
613 \membersection{wxSocketBase::Read}\label{wxsocketbaseread}
614
615 \func{wxSocketBase\&}{Read}{\param{char *}{ buffer}, \param{wxUint32}{ nbytes}}
616
617 This function reads a buffer of {\it nbytes} bytes from the socket.
618
619 Use \helpref{LastCount}{wxsocketbaselastcount} to verify the number of bytes actually read.
620
621 Use \helpref{Error}{wxsocketbaseerror} to determine if the operation succeeded.
622
623 \wxheading{Parameters}
624
625 \docparam{buffer}{Buffer where to put read data.}
626
627 \docparam{nbytes}{Number of bytes.}
628
629 \wxheading{Return value}
630
631 Returns a reference to the current object.
632
633 \wxheading{Remark/Warning}
634
635 The exact behaviour of wxSocketBase::Read depends on the combination
636 of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
637
638 \wxheading{See also}
639
640 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
641 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
642 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
643 \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
644
645 %
646 % ReadMsg
647 %
648 \membersection{wxSocketBase::ReadMsg}\label{wxsocketbasereadmsg}
649
650 \func{wxSocketBase\&}{ReadMsg}{\param{char *}{ buffer}, \param{wxUint32}{ nbytes}}
651
652 This function reads a buffer sent by \helpref{WriteMsg}{wxsocketbasewritemsg}
653 on a socket. If the buffer passed to the function isn't big enough, the
654 remaining bytes will be discarded. This function always waits for the
655 buffer to be entirely filled, unless an error occurs.
656
657 Use \helpref{LastCount}{wxsocketbaselastcount} to verify the number of bytes actually read.
658
659 Use \helpref{Error}{wxsocketbaseerror} to determine if the operation succeeded.
660
661 \wxheading{Parameters}
662
663 \docparam{buffer}{Buffer where to put read data.}
664
665 \docparam{nbytes}{Size of the buffer.}
666
667 \wxheading{Return value}
668
669 Returns a reference to the current object.
670
671 \wxheading{Remark/Warning}
672
673 wxSocketBase::ReadMsg will behave as if the {\bf wxSOCKET\_WAITALL} flag
674 was always set and it will always ignore the {\bf wxSOCKET\_NOWAIT} flag.
675 The exact behaviour of ReadMsg depends on the {\bf wxSOCKET\_BLOCK} flag.
676 For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
677
678 \wxheading{See also}
679
680 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
681 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
682 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
683 \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags},
684 \helpref{wxSocketBase::WriteMsg}{wxsocketbasewritemsg}
685
686 %
687 % Unread
688 %
689 \membersection{wxSocketBase::Unread}\label{wxsocketbaseunread}
690
691 \func{wxSocketBase\&}{Unread}{\param{const char *}{ buffer}, \param{wxUint32}{ nbytes}}
692
693 This function unreads a buffer. That is, the data in the buffer is put back
694 in the incoming queue. This function is not affected by wxSocket flags.
695
696 If you use \helpref{LastCount}{wxsocketbaselastcount}, it will always return {\it nbytes}.
697
698 If you use \helpref{Error}{wxsocketbaseerror}, it will always return FALSE.
699
700 \wxheading{Parameters}
701
702 \docparam{buffer}{Buffer to be unread.}
703
704 \docparam{nbytes}{Number of bytes.}
705
706 \wxheading{Return value}
707
708 Returns a reference to the current object.
709
710 \wxheading{See also}
711
712 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
713 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
714 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
715
716 %
717 % Wait
718 %
719 \membersection{wxSocketBase::Wait}\label{wxsocketbasewait}
720
721 \func{bool}{Wait}{\param{long}{ seconds = -1}, \param{long}{ millisecond = 0}}
722
723 This function waits until one of the following conditions is TRUE. Note
724 that it is recommended to use the individual Wait functions to wait for
725 the required condition, instead of this one.
726
727 \begin{itemize}
728 \item The socket becomes readable.
729 \item The socket becomes writable.
730 \item An ongoing connection request has completed (only for clients)
731 \item An incoming connection request has arrived (only for servers)
732 \item The connection has been closed.
733 \end{itemize}
734
735 \wxheading{Parameters}
736
737 \docparam{seconds}{Number of seconds to wait.
738 If -1, it will wait for the default timeout,
739 as set with \helpref{SetTimeout}{wxsocketbasesettimeout}.}
740
741 \docparam{millisecond}{Number of milliseconds to wait.}
742
743 \wxheading{Return value}
744
745 Returns TRUE when any of the above conditions is satisfied,
746 FALSE if the timeout was reached.
747
748 \wxheading{See also}
749
750 \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
751 \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
752 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
753
754 %
755 % WaitForRead
756 %
757 \membersection{wxSocketBase::WaitForRead}\label{wxsocketbasewaitforread}
758
759 \func{bool}{WaitForRead}{\param{long}{ seconds = -1}, \param{long}{ millisecond = 0}}
760
761 This function waits until the socket is readable. This might mean that
762 queued data is available for reading or, for streamed sockets, that
763 the connection has been closed, so that a read operation will complete
764 immediately without blocking (unless the {\bf wxSOCKET\_WAITALL} flag
765 is set, in which case the operation might still block).
766
767 \wxheading{Parameters}
768
769 \docparam{seconds}{Number of seconds to wait.
770 If -1, it will wait for the default timeout,
771 as set with \helpref{SetTimeout}{wxsocketbasesettimeout}.}
772
773 \docparam{millisecond}{Number of milliseconds to wait.}
774
775 \wxheading{Return value}
776
777 Returns TRUE if the socket becomes readable, FALSE on timeout.
778
779 \wxheading{See also}
780
781 \helpref{wxSocketBase::Wait}{wxsocketbasewait},
782 \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
783 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
784
785 %
786 % WaitForWrite
787 %
788 \membersection{wxSocketBase::WaitForWrite}\label{wxsocketbasewaitforwrite}
789
790 \func{bool}{WaitForWrite}{\param{long}{ seconds = -1}, \param{long}{ millisecond = 0}}
791
792 This function waits until the socket becomes writable. This might mean that
793 the socket is ready to send new data, or for streamed sockets, that the
794 connection has been closed, so that a write operation is guaranteed to
795 complete immediately (unless the {\bf wxSOCKET\_WAITALL} flag is set,
796 in which case the operation might still block).
797
798 \wxheading{Parameters}
799
800 \docparam{seconds}{Number of seconds to wait.
801 If -1, it will wait for the default timeout,
802 as set with \helpref{SetTimeout}{wxsocketbasesettimeout}.}
803
804 \docparam{millisecond}{Number of milliseconds to wait.}
805
806 \wxheading{Return value}
807
808 Returns TRUE if the socket becomes writable, FALSE on timeout.
809
810 \wxheading{See also}
811
812 \helpref{wxSocketBase::Wait}{wxsocketbasewait},
813 \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
814 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
815
816 %
817 % WaitForLost
818 %
819 \membersection{wxSocketBase::WaitForLost}\label{wxsocketbasewaitforlost}
820
821 \func{bool}{Wait}{\param{long}{ seconds = -1}, \param{long}{ millisecond = 0}}
822
823 This function waits until the connection is lost. This may happen if
824 the peer gracefully closes the connection or if the connection breaks.
825
826 \wxheading{Parameters}
827
828 \docparam{seconds}{Number of seconds to wait.
829 If -1, it will wait for the default timeout,
830 as set with \helpref{SetTimeout}{wxsocketbasesettimeout}.}
831
832 \docparam{millisecond}{Number of milliseconds to wait.}
833
834 \wxheading{Return value}
835
836 Returns TRUE if the connection was lost, FALSE if the timeout was reached.
837
838 \wxheading{See also}
839
840 \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
841 \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
842 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
843
844 %
845 % Write
846 %
847 \membersection{wxSocketBase::Write}\label{wxsocketbasewrite}
848
849 \func{wxSocketBase\&}{Write}{\param{const char *}{ buffer}, \param{wxUint32}{ nbytes}}
850
851 This function writes a buffer of {\it nbytes} bytes to the socket.
852
853 Use \helpref{LastCount}{wxsocketbaselastcount} to verify the number of bytes actually written.
854
855 Use \helpref{Error}{wxsocketbaseerror} to determine if the operation succeeded.
856
857 \wxheading{Parameters}
858
859 \docparam{buffer}{Buffer with the data to be sent.}
860
861 \docparam{nbytes}{Number of bytes.}
862
863 \wxheading{Return value}
864
865 Returns a reference to the current object.
866
867 \wxheading{Remark/Warning}
868
869 The exact behaviour of wxSocketBase::Write depends on the combination
870 of flags being used. For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
871
872 \wxheading{See also}
873
874 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
875 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
876 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
877 \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}
878
879 %
880 % WriteMsg
881 %
882 \membersection{wxSocketBase::WriteMsg}\label{wxsocketbasewritemsg}
883
884 \func{wxSocketBase\&}{WriteMsg}{\param{const char *}{ buffer}, \param{wxUint32}{ nbytes}}
885
886 This function writes a buffer of {\it nbytes} bytes from the socket, but it
887 writes a short header before so that \helpref{ReadMsg}{wxsocketbasereadmsg}
888 knows how much data should it actually read. So, a buffer sent with WriteMsg
889 {\bf must} be read with ReadMsg. This function always waits for the entire
890 buffer to be sent, unless an error occurs.
891
892 Use \helpref{LastCount}{wxsocketbaselastcount} to verify the number of bytes actually written.
893
894 Use \helpref{Error}{wxsocketbaseerror} to determine if the operation succeeded.
895
896 \wxheading{Parameters}
897
898 \docparam{buffer}{Buffer with the data to be sent.}
899
900 \docparam{nbytes}{Number of bytes to send.}
901
902 \wxheading{Return value}
903
904 Returns a reference to the current object.
905
906 \wxheading{Remark/Warning}
907
908 wxSocketBase::WriteMsg will behave as if the {\bf wxSOCKET\_WAITALL} flag
909 was always set and it will always ignore the {\bf wxSOCKET\_NOWAIT} flag.
910 The exact behaviour of WriteMsg depends on the {\bf wxSOCKET\_BLOCK} flag.
911 For a detailed explanation, see \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags}.
912
913 \wxheading{See also}
914
915 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
916 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
917 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
918 \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags},
919 \helpref{wxSocketBase::ReadMsg}{wxsocketbasereadmsg}
920
921
922 % ---------------------------------------------------------------------------
923 % CLASS wxSocketClient
924 % ---------------------------------------------------------------------------
925
926 \section{\class{wxSocketClient}}\label{wxsocketclient}
927
928 \wxheading{Derived from}
929
930 \helpref{wxSocketBase}{wxsocketbase}
931
932 \wxheading{Include files}
933
934 <wx/socket.h>
935
936 % ---------------------------------------------------------------------------
937 % Members
938 % ---------------------------------------------------------------------------
939 %
940 % wxSocketClient
941 %
942 \membersection{wxSocketClient::wxSocketClient}
943
944 \func{}{wxSocketClient}{\param{wxSockFlags}{ flags = wxSocketBase::NONE}}
945
946 Constructor.
947
948 \wxheading{Parameters}
949
950 \docparam{flags}{Socket flags (See \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags})}
951
952 %
953 % ~wxSocketClient
954 %
955 \membersection{wxSocketClient::\destruct{wxSocketClient}}
956
957 \func{}{\destruct{wxSocketClient}}{\void}
958
959 Destructor.
960
961 %
962 % Connect
963 %
964 \membersection{wxSocketClient::Connect}\label{wxsocketclientconnect}
965
966 \func{bool}{Connect}{\param{wxSockAddress\&}{ address}, \param{bool}{ wait = TRUE}}
967
968 Connects to a server using the specified address.
969
970 If {\it wait} is TRUE, Connect will wait until the connection completes.
971 {\bf Warning:} This will block the GUI.
972
973 If {\it wait} is FALSE, Connect will try to establish the connection and
974 return immediately, without blocking the GUI. When used this way, even if
975 Connect returns FALSE, the connection request can be completed later.
976 To detect this, use \helpref{WaitOnConnect}{wxsocketclientwaitonconnect},
977 or catch {\bf wxSOCKET\_CONNECTION} events (for successful establishment)
978 and {\bf wxSOCKET\_LOST} events (for connection failure).
979
980 \wxheading{Parameters}
981
982 \docparam{address}{Address of the server.}
983
984 \docparam{wait}{If TRUE, waits for the connection to complete.}
985
986 \wxheading{Return value}
987
988 Returns TRUE if the connection is established and no error occurs.
989
990 If {\it wait} was TRUE, and Connect returns FALSE, an error occured
991 and the connection failed.
992
993 If {\it wait} was FALSE, and Connect returns FALSE, you should still
994 be prepared to handle the completion of this connection request, either
995 with \helpref{WaitOnConnect}{wxsocketclientwaitonconnect} or by watching
996 {\bf wxSOCKET\_CONNECTION} and {\bf wxSOCKET\_LOST} events.
997
998 \wxheading{See also}
999
1000 \helpref{wxSocketClient::WaitOnConnect}{wxsocketclientwaitonconnect},
1001 \helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
1002 \helpref{wxSocketBase::Notify}{wxsocketbasenotify}
1003
1004 %
1005 % WaitOnConnect
1006 %
1007 \membersection{wxSocketClient::WaitOnConnect}\label{wxsocketclientwaitonconnect}
1008
1009 \func{bool}{WaitOnConnect}{\param{long}{ seconds = -1}, \param{long}{ milliseconds = 0}}
1010
1011 Wait until a connection request completes, or until the specified timeout
1012 elapses. Use this function after issuing a call to \helpref{Connect}{wxsocketclientconnect}
1013 with {\it wait} set to FALSE.
1014
1015 \wxheading{Parameters}
1016
1017 \docparam{seconds}{Number of seconds to wait.
1018 If -1, it will wait for the default timeout,
1019 as set with \helpref{SetTimeout}{wxsocketbasesettimeout}.}
1020
1021 \docparam{millisecond}{Number of milliseconds to wait.}
1022
1023 \wxheading{Return value}
1024
1025 WaitOnConnect returns TRUE if the connection request completes. This
1026 does not necessarily mean that the connection was succesfully established;
1027 it might also happen that the connection was refused by the peer. Use
1028 \helpref{IsConnected}{wxsocketbaseisconnected} to distinguish between
1029 these two situations.
1030
1031 If the timeout elapses, WaitOnConnect returns FALSE.
1032
1033 These semantics allow code like this:
1034
1035 \begin{verbatim}
1036 // Issue the connection request
1037 client->Connect(addr, FALSE);
1038
1039 // Wait until the request completes or until we decide to give up
1040 bool waitmore = TRUE;
1041 while ( !client->WaitOnConnect(seconds, millis) && waitmore )
1042 {
1043 // possibly give some feedback to the user,
1044 // and update waitmore if needed.
1045 }
1046 bool success = client->IsConnected();
1047 \end{verbatim}
1048
1049 \wxheading{See also}
1050
1051 \helpref{wxSocketClient::Connect}{wxsocketclientconnect},
1052 \helpref{wxSocketBase::IsConnected}{wxsocketbaseisconnected}
1053
1054 % ---------------------------------------------------------------------------
1055 % CLASS: wxSocketEvent
1056 % ---------------------------------------------------------------------------
1057 \section{\class{wxSocketEvent}}\label{wxsocketevent}
1058
1059 This event class contains information about socket events.
1060
1061 \wxheading{Derived from}
1062
1063 \helpref{wxEvent}{wxevent}
1064
1065 \wxheading{Include files}
1066
1067 <wx/socket.h>
1068
1069 \wxheading{Event table macros}
1070
1071 To process a socket event, use these event handler macros to direct input to member
1072 functions that take a wxSocketEvent argument.
1073
1074 \twocolwidtha{7cm}
1075 \begin{twocollist}\itemsep=0pt
1076 \twocolitem{{\bf EVT\_SOCKET(id, func)}}{Process a socket event, supplying the member function.}
1077 \end{twocollist}
1078
1079 \wxheading{See also}
1080
1081 \helpref{wxSocketBase}{wxsocketbase},
1082 \helpref{wxSocketClient}{wxsocketclient},
1083 \helpref{wxSocketServer}{wxsocketserver}
1084
1085 \latexignore{\rtfignore{\wxheading{Members}}}
1086
1087 \membersection{wxSocketEvent::wxSocketEvent}
1088
1089 \func{}{wxSocketEvent}{\param{int}{ id = 0}}
1090
1091 Constructor.
1092
1093 \membersection{wxSocketEvent::Socket}\label{wxsocketeventsocket}
1094
1095 \constfunc{wxSocketBase *}{Socket}{\void}
1096
1097 Returns the socket object to which this event refers to. This makes
1098 it possible to use the same event handler for different sockets.
1099
1100 \membersection{wxSocketEvent::SocketEvent}\label{wxsocketeventsocketevent}
1101
1102 \constfunc{wxSocketNotify}{SocketEvent}{\void}
1103
1104 Returns the socket event type.
1105
1106 % ---------------------------------------------------------------------------
1107 % CLASS: wxSocketServer
1108 % ---------------------------------------------------------------------------
1109 \section{\class{wxSocketServer}}\label{wxsocketserver}
1110
1111 \wxheading{Derived from}
1112
1113 \helpref{wxSocketBase}{wxsocketbase}
1114
1115 \wxheading{Include files}
1116
1117 <wx/socket.h>
1118
1119 % ---------------------------------------------------------------------------
1120 % Members
1121 % ---------------------------------------------------------------------------
1122 \latexignore{\rtfignore{\wxheading{Members}}}
1123
1124 %
1125 % wxSocketServer
1126 %
1127 \membersection{wxSocketServer::wxSocketServer}\label{wxsocketserverconstr}
1128
1129 \func{}{wxSocketServer}{\param{wxSockAddress\&}{ address}, \param{wxSockFlags}{ flags = wxSocketBase::NONE}}
1130
1131 Constructs a new server and tries to bind to the specified {\it address}.
1132 Before trying to accept new connections, test whether it succeeded with
1133 \helpref{wxSocketBase::Ok}{wxsocketbaseok}.
1134
1135 \wxheading{Parameters}
1136
1137 \docparam{address}{Specifies the local address for the server (e.g. port number).}
1138
1139 \docparam{flags}{Socket flags (See \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags})}
1140
1141 %
1142 % ~wxSocketServer
1143 %
1144 \membersection{wxSocketServer::\destruct{wxSocketServer}}
1145
1146 \func{}{\destruct{wxSocketServer}}{\void}
1147
1148 Destructor (it doesn't close the accepted connections).
1149
1150 %
1151 % Accept
1152 %
1153 \membersection{wxSocketServer::Accept}\label{wxsocketserveraccept}
1154
1155 \func{wxSocketBase *}{Accept}{\param{bool}{ wait = TRUE}}
1156
1157 Accepts an incoming connection request, and creates a new
1158 \helpref{wxSocketBase}{wxsocketbase} object which represents
1159 the server-side of the connection.
1160
1161 If {\it wait} is TRUE and there are no pending connections to be
1162 accepted, it will wait for the next incoming connection to arrive.
1163 {\bf Warning:} This will block the GUI.
1164
1165 If {\it wait} is FALSE, it will try to accept a pending connection
1166 if there is one, but it will always return immediately without blocking
1167 the GUI. If you want to use Accept in this way, you can either check for
1168 incoming connections with \helpref{WaitForAccept}{wxsocketserverwaitforaccept}
1169 or catch {\bf wxSOCKET\_CONNECTION} events, then call Accept once you know
1170 that there is an incoming connection waiting to be accepted.
1171
1172 \wxheading{Return value}
1173
1174 Returns an opened socket connection, or NULL if an error occured or
1175 if the {\it wait} parameter was FALSE and there were no pending
1176 connections.
1177
1178 \wxheading{See also}
1179
1180 \helpref{wxSocketServer::WaitForAccept}{wxsocketserverwaitforaccept},
1181 \helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
1182 \helpref{wxSocketBase::Notify}{wxsocketbasenotify},
1183 \helpref{wxSocketServer::AcceptWith}{wxsocketserveracceptwith}
1184
1185 %
1186 % AcceptWith
1187 %
1188 \membersection{wxSocketServer::AcceptWith}\label{wxsocketserveracceptwith}
1189
1190 \func{bool}{AcceptWith}{\param{wxSocketBase\&}{ socket}, \param{bool}{ wait = TRUE}}
1191
1192 Accept an incoming connection using the specified socket object.
1193
1194 \wxheading{Parameters}
1195
1196 \docparam{socket}{Socket to be initialized}
1197
1198 \wxheading{Return value}
1199
1200 Returns TRUE on success, or FALSE if an error occured or if the
1201 {\it wait} parameter was FALSE and there were no pending
1202 connections.
1203
1204 \helpref{wxSocketServer::WaitForAccept}{wxsocketserverwaitforaccept},
1205 \helpref{wxSocketBase::SetNotify}{wxsocketbasesetnotify},
1206 \helpref{wxSocketBase::Notify}{wxsocketbasenotify},
1207 \helpref{wxSocketServer::Accept}{wxsocketserveraccept} for a detailed explanation
1208
1209 %
1210 % WaitForAccept
1211 %
1212 \membersection{wxSocketServer::WaitForAccept}\label{wxsocketserverwaitforaccept}
1213
1214 \func{bool}{WaitForAccept}{\param{long}{ seconds = -1}, \param{long}{ millisecond = 0}}
1215
1216 This function waits for an incoming connection. Use it if you want to call
1217 \helpref{Accept}{wxsocketserveraccept} or \helpref{AcceptWith}{wxsocketserveracceptwith}
1218 with {\it wait} set to FALSE, to detect when an incoming connection is waiting
1219 to be accepted.
1220
1221 \wxheading{Parameters}
1222
1223 \docparam{seconds}{Number of seconds to wait.
1224 If -1, it will wait for the default timeout,
1225 as set with \helpref{SetTimeout}{wxsocketbasesettimeout}.}
1226
1227 \docparam{millisecond}{Number of milliseconds to wait.}
1228
1229 \wxheading{Return value}
1230
1231 Returns TRUE if an incoming connection arrived, FALSE if the timeout elapsed.
1232
1233 \wxheading{See also}
1234
1235 \helpref{wxSocketServer::Accept}{wxsocketserveraccept},
1236 \helpref{wxSocketServer::AcceptWith}{wxsocketserveracceptwith}
1237