]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/socket.tex
* A few updates (stream doc)
[wxWidgets.git] / docs / latex / wx / socket.tex
1 \section{\class{wxSocketBase}}\label{wxsocketbase}
2
3 \wxheading{Derived from}
4
5 \helpref{wxEvtHandler}{wxevthandler}
6
7 % ---------------------------------------------------------------------------
8 % Event handling
9 % ---------------------------------------------------------------------------
10 \wxheading{Event handling}
11
12 To process events from a socket, use the following event handler macro to direct
13 input to member
14 functions that take a \helpref{wxSocketEvent}{wxsocketevent} argument.
15
16 \twocolwidtha{7cm}%
17 \begin{twocollist}\itemsep=0pt
18 \twocolitem{{\bf EVT\_SOCKET(id, func)}}{A socket event occured.}
19 \end{twocollist}%
20
21 % ---------------------------------------------------------------------------
22 % See also ...
23 % ---------------------------------------------------------------------------
24 \wxheading{See also}
25
26 \helpref{wxSocketEvent}{wxsocketevent}, \helpref{wxSocketClient}{wxsocketclient}, \helpref{wxSocketServer}{wxsocketserver}
27
28 % ---------------------------------------------------------------------------
29 % Members
30 % ---------------------------------------------------------------------------
31 \latexignore{\rtfignore{\wxheading{Members}}}
32
33 \membersection{wxSocketBase::wxSocketBase}
34
35 \func{}{wxSocketBase}{\void}
36
37 Default constructor but don't use it, you must use \helpref{wxSocketClient}{wxsocketclient}
38 or \helpref{wxSocketServer}{wxsocketserver}.
39
40 \membersection{wxSocketBase::\destruct{wxSocketBase}}
41
42 \func{}{\destruct{wxSocketBase}}{\void}
43
44 Destroys the wxSocketBase object.
45
46 % ---------------------------------------------------------------------------
47 % State functions
48 % ---------------------------------------------------------------------------
49
50 \membersection{wxSocketBase::Ok}\label{wxsocketbaseok}
51
52 \constfunc{bool}{Ok}{\void}
53
54 Returns TRUE if the socket is initialized and ready and FALSE in other
55 cases.
56
57 \membersection{wxSocketBase::Error}\label{wxsocketbaseerror}
58
59 \constfunc{bool}{Error}{\void}
60
61 Returns TRUE if an error occured.
62
63 \membersection{wxSocketBase::IsConnected}\label{wxsocketbaseconnected}
64
65 \constfunc{bool}{IsConnected}{\void}
66
67 Returns TRUE if the socket is connected.
68
69 \membersection{wxSocketBase::IsData}\label{wxsocketbaseisdata}
70
71 \constfunc{bool}{IsData}{\void}
72
73 Returns TRUE if some data is arrived on the socket.
74
75 \membersection{wxSocketBase::IsDisconnected}\label{wxsocketbasedisconnected}
76
77 \constfunc{bool}{IsDisconnected}{\void}
78
79 Returns TRUE if the socket is disconnected.
80
81 \membersection{wxSocketBase::IsNoWait}\label{wxsocketbasenowait}
82
83 \constfunc{bool}{IsNoWait}{\void}
84
85 Returns TRUE if the socket mustn't wait.
86
87 \membersection{wxSocketBase::LastCount}\label{wxsocketbaselastcount}
88
89 \constfunc{size\_t}{LastCount}{\void}
90
91 Returns the number of bytes read or written by the last IO call.
92
93 \membersection{wxSocketBase::LastError}\label{wxsocketbaselasterror}
94
95 \constfunc{int}{LastError}{\void}
96
97 Returns an error in the errno format (see your C programmer's guide).
98
99 % ---------------------------------------------------------------------------
100 % IO calls
101 % ---------------------------------------------------------------------------
102 %
103 % Peek
104 %
105 \membersection{wxSocketBase::Peek}\label{wxsocketbasepeek}
106
107 \func{wxSocketBase\&}{Peek}{\param{char *}{ buffer}, \param{size\_t}{ nbytes}}
108
109 This function peeks a buffer of {\it nbytes} bytes from the socket. Peeking a buffer
110 doesn't delete it from the system socket in-queue.
111
112 \wxheading{Parameters}
113
114 \docparam{buffer}{Buffer where to put peeked data.}
115
116 \docparam{nbytes}{Number of bytes.}
117
118 \wxheading{Return value}
119
120 Returns a reference to the current object.
121
122 \wxheading{See also}
123
124 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
125 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
126 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
127
128 %
129 % Read
130 %
131 \membersection{wxSocketBase::Read}\label{wxsocketbaseread}
132
133 \func{wxSocketBase\&}{Read}{\param{char *}{ buffer}, \param{size\_t}{ nbytes}}
134
135 This function reads a buffer of {\it nbytes} bytes from the socket.
136
137 \wxheading{Parameters}
138
139 \docparam{buffer}{Buffer where to put read data.}
140
141 \docparam{nbytes}{Number of bytes.}
142
143 \wxheading{Return value}
144
145 Returns a reference to the current object.
146
147 \wxheading{See also}
148
149 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
150 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
151 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
152
153 \membersection{wxSocketBase::SetFlags}\label{wxsocketbasesetflags}
154
155 \func{void}{SetFlags}{\param{wxSockFlags}{ flags}}
156
157 \twocolwidtha{7cm}
158 \begin{twocollist}\itemsep=0pt
159 \twocolitem{{\bf wxSocketBase::NONE}}{Normal functionnalities.}
160 \twocolitem{{\bf wxSocketBase::NOWAIT}}{Get the available data in the input queue and exit immediately.}
161 \twocolitem{{\bf wxSocketBase::WAITALL}}{Wait for all required data unless an error occured.}
162 \twocolitem{{\bf wxSocketBase::SPEED}}{Disable the asynchronous IO functionnality.}
163 \end{twocollist}
164
165 %
166 % Read
167 %
168 \membersection{wxSocketBase::Write}\label{wxsocketbasewrite}
169
170 \func{wxSocketBase\&}{Write}{\param{const char *}{ buffer}, \param{size\_t}{ nbytes}}
171
172 This function writes a buffer of {\it nbytes} bytes from the socket.
173
174 \wxheading{Parameters}
175
176 \docparam{buffer}{Buffer where to get the data to write.}
177
178 \docparam{nbytes}{Number of bytes.}
179
180 \wxheading{Return value}
181
182 Returns a reference to the current object.
183
184 \wxheading{See also}
185
186 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
187 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
188 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
189
190 %
191 % WriteMsg
192 %
193 \membersection{wxSocketBase::WriteMsg}\label{wxsocketbasewritemsg}
194
195 \func{wxSocketBase\&}{WriteMsg}{\param{const char *}{ buffer}, \param{size\_t}{ nbytes}}
196
197 This function writes a buffer of {\it nbytes} bytes from the socket. But it
198 writes a short header before so that ReadMsg can alloc the right size for
199 the buffer. So a buffer sent with WriteMsg {\bf must} be read with ReadMsg.
200
201 \wxheading{Parameters}
202
203 \docparam{buffer}{Buffer where to put data peeked.}
204
205 \docparam{nbytes}{Number of bytes.}
206
207 \wxheading{Return value}
208
209 Returns a reference to the current object.
210
211 \wxheading{See also}
212
213 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
214 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
215 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
216 \helpref{wxSocketBase::ReadMsg}{wxsocketbasereadmsg}
217
218 %
219 % ReadMsg
220 %
221 \membersection{wxSocketBase::ReadMsg}\label{wxsocketbasereadmsg}
222
223 \func{wxSocketBase\&}{ReadMsg}{\param{char *}{ buffer}, \param{size\_t}{ nbytes}}
224
225 This function reads a buffer sent by WriteMsg on a socket. If the buffer passed
226 to the function isn't big enough, the function filled it and then discard the
227 bytes left. This function always wait for the buffer to be entirely filled.
228
229 \wxheading{Parameters}
230
231 \docparam{buffer}{Buffer where to put read data.}
232
233 \docparam{nbytes}{Number of bytes allocated for the buffer.}
234
235 \wxheading{Return value}
236
237 Returns a reference to the current object.
238
239 \wxheading{See also}
240
241 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
242 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
243 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror},
244 \helpref{wxSocketBase::WriteMsg}{wxsocketbasewritemsg}
245
246 %
247 % Unread
248 %
249 \membersection{wxSocketBase::UnRead}\label{wxsocketbaseunread}
250
251 \func{wxSocketBase\&}{UnRead}{\param{const char *}{ buffer}, \param{size\_t}{ nbytes}}
252
253 This function unreads a buffer. It means that the buffer is put in the top
254 of the incoming queue. But, it is put also at the end of all unread buffers.
255 It is useful for sockets because we can't seek it.
256
257 \wxheading{Parameters}
258
259 \docparam{buffer}{Buffer to be unread.}
260
261 \docparam{nbytes}{Number of bytes.}
262
263 \wxheading{Return value}
264
265 Returns a reference to the current object.
266
267 \wxheading{See also}
268
269 \helpref{wxSocketBase::Error}{wxsocketbaseerror},
270 \helpref{wxSocketBase::LastCount}{wxsocketbaselastcount},
271 \helpref{wxSocketBase::LastError}{wxsocketbaselasterror}
272
273 %
274 % Discard
275 %
276 \membersection{wxSocketBase::Discard}\label{wxsocketbasediscard}
277
278 \func{wxSocketBase\&}{Discard}{\void}
279
280 This function simply deletes all bytes in the incoming queue. This function
281 doesn't wait.
282
283 % ---------------------------------------------------------------------------
284 % Wait functions
285 % ---------------------------------------------------------------------------
286 \membersection{wxSocketBase::Wait}\label{wxsocketbasewait}
287
288 \func{bool}{Wait}{\param{long}{ seconds = -1}, \param{long}{ microsecond = 0}}
289
290 This function waits for an event: it could be an incoming byte, the possibility
291 for the client to write, a lost connection, an incoming connection, an
292 established connection.
293
294 \wxheading{Parameters}
295
296 \docparam{seconds}{Number of seconds to wait. By default, it waits infinitely.}
297
298 \docparam{microsecond}{Number of microseconds to wait.}
299
300 \wxheading{Return value}
301
302 Returns TRUE if an event occured, FALSE if the timeout was reached.
303
304 \wxheading{See also}
305
306 \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
307 \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
308 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
309
310 %
311 % WaitForRead
312 %
313 \membersection{wxSocketBase::WaitForRead}\label{wxsocketbasewaitforread}
314
315 \func{bool}{WaitForRead}{\param{long}{ seconds = -1}, \param{long}{ microsecond = 0}}
316
317 This function waits for a read event.
318
319 \wxheading{Parameters}
320
321 \docparam{seconds}{Number of seconds to wait. By default, it waits infinitely.}
322
323 \docparam{microsecond}{Number of microseconds to wait.}
324
325 \wxheading{Return value}
326
327 Returns TRUE if a byte arrived, FALSE if the timeout was reached.
328
329 \wxheading{See also}
330
331 \helpref{wxSocketBase::Wait}{wxsocketbasewait},
332 \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
333 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
334
335 %
336 % WaitForWrite
337 %
338 \membersection{wxSocketBase::WaitForWrite}\label{wxsocketbasewaitforwrite}
339
340 \func{bool}{WaitForWrite}{\param{long}{ seconds = -1}, \param{long}{ microsecond = 0}}
341
342 This function waits for a write event.
343
344 \wxheading{Parameters}
345
346 \docparam{seconds}{Number of seconds to wait. By default, it waits infinitely.}
347
348 \docparam{microsecond}{Number of microseconds to wait.}
349
350 \wxheading{Return value}
351
352 Returns TRUE if a write event occured, FALSE if the timeout was reached.
353
354 \wxheading{See also}
355
356 \helpref{wxSocketBase::Wait}{wxsocketbasewait},
357 \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
358 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
359
360 %
361 % WaitForLost
362 %
363 \membersection{wxSocketBase::WaitForLost}\label{wxsocketbasewaitforlost}
364
365 \func{bool}{Wait}{\param{long}{ seconds = -1}, \param{long}{ microsecond = 0}}
366
367 This function waits for a "lost" event. For instance, the peer may have closed
368 the connection, or the connection may have been broken.
369
370 \wxheading{Parameters}
371
372 \docparam{seconds}{Number of seconds to wait. By default, it waits infinitely.}
373
374 \docparam{microsecond}{Number of microseconds to wait.}
375
376 \wxheading{Return value}
377
378 Returns TRUE if a "lost" event occured, FALSE if the timeout was reached.
379
380 \wxheading{See also}
381
382 \helpref{wxSocketBase::WaitForRead}{wxsocketbasewaitforread},
383 \helpref{wxSocketBase::WaitForWrite}{wxsocketbasewaitforwrite},
384 \helpref{wxSocketBase::WaitForLost}{wxsocketbasewaitforlost}
385
386 %
387 % RestoreState
388 %
389 \membersection{wxSocketBase::RestoreState}\label{wxsocketbaserestorestate}
390
391 \func{void}{RestoreState}{\void}
392
393 This function restores a previously saved state.
394
395 \wxheading{See also}
396
397 \helpref{wxSocketBase::SaveState}{wxsocketbasesavestate}
398
399 % ---------------------------------------------------------------------------
400 % Socket state
401 % ---------------------------------------------------------------------------
402 %
403 % SaveState
404 %
405 \membersection{wxSocketBase::SaveState}\label{wxsocketbasesavestate}
406
407 \func{void}{SaveState}{\void}
408
409 This function saves the current state of the socket object in a stack:
410 actually it saves all flags and the state of the asynchronous callbacks.
411
412 \wxheading{See also}
413
414 \helpref{wxSocketBase::RestoreState}{wxsocketbaserestorestate}
415
416 % ---------------------------------------------------------------------------
417 % Socket callbacks
418 % ---------------------------------------------------------------------------
419 \membersection{wxSocketBase::SetEventHandler}\label{wxsocketbaseseteventhandler}
420
421 \func{void}{SetEventHandler}{\param{wxEvtHandler\&}{ evt\_hdlr}, \param{int}{ id = -1}}
422
423 Sets an event handler to be called when a socket event occured.
424
425 \wxheading{Parameters}
426
427 \docparam{evt\_hdlr}{Specifies the event handler you want to use.}
428
429 \docparam{id}{The id of socket event.}
430
431 \wxheading{See also}
432
433 \helpref{wxSocketEvent}{wxsocketevent}
434
435 % ---------------------------------------------------------------------------
436 % CLASS wxSocketClient
437 % ---------------------------------------------------------------------------
438 \section{\class{wxSocketClient}}\label{wxsocketclient}
439
440 \wxheading{Derived from}
441
442 \helpref{wxSocketBase}{wxsocketbase}
443
444 % ---------------------------------------------------------------------------
445 % Members
446 % ---------------------------------------------------------------------------
447 %
448 % wxSocketClient
449 %
450 \membersection{wxSocketClient::wxSocketClient}
451
452 \func{}{wxSocketClient}{\param{wxSockFlags}{ flags = wxSocketBase::NONE}}
453
454 Constructs a new wxSocketClient.
455
456 {\bf Warning !} The created socket client needs to be registered to a socket handler (See \helpref{wxSocketHandler}{wxsockethandler}).
457
458 \wxheading{Parameters}
459
460 \docparam{flags}{Socket flags (See \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags})}
461
462 %
463 % ~wxSocketClient
464 %
465 \membersection{wxSocketClient::\destruct{wxSocketClient}}
466
467 \func{}{\destruct{wxSocketClient}}{\void}
468
469 Destructs a wxSocketClient object.
470
471 %
472 % Connect
473 %
474 \membersection{wxSocketClient::Connect}\label{wxsocketclientconnect}
475
476 \func{bool}{Connect}{\param{wxSockAddress\&}{ address}, \param{bool}{ wait = TRUE}}
477
478 Connects to a server using the specified address. If {\it wait} is TRUE, Connect
479 will wait for the socket ready to send or receive data.
480
481 \wxheading{Parameters}
482
483 \docparam{address}{Address of the server.}
484
485 \docparam{wait}{If true, waits for the connection to be ready.}
486
487 \wxheading{Return value}
488
489 Returns TRUE if the connection is established and no error occurs.
490
491 \wxheading{See also}
492
493 \helpref{wxSocketClient::WaitOnConnect}{wxsocketclientwaitonconnect}
494
495 %
496 % WaitOnConnect
497 %
498 \membersection{wxSocketClient::WaitOnConnect}\label{wxsocketclientwaitonconnect}
499
500 \func{bool}{WaitOnConnect}{\param{long}{ seconds = -1}, \param{long}{ microseconds = 0}}
501
502 Wait for a "connect" event.
503
504 \wxheading{See also}
505
506 \helpref{wxSocketBase::Wait}{wxsocketbasewait} for a detailed description.
507
508 % ---------------------------------------------------------------------------
509 % CLASS: wxSocketEvent
510 % ---------------------------------------------------------------------------
511 \section{\class{wxSocketEvent}}\label{wxsocketevent}
512
513 This event class contains information about socket events.
514
515 \wxheading{Derived from}
516
517 \helpref{wxEvent}{wxevent}
518
519 \wxheading{Event table macros}
520
521 To process a socket event, use these event handler macros to direct input to member
522 functions that take a wxSocketEvent argument.
523
524 \twocolwidtha{7cm}
525 \begin{twocollist}\itemsep=0pt
526 \twocolitem{{\bf EVT\_SOCKET(id, func)}}{Process a socket event, supplying the member function.}
527 \end{twocollist}%
528
529 \wxheading{See also}
530
531 \helpref{wxSocketHandler}{wxsockethandler},\rtfsp
532 \helpref{wxSocketBase}{wxsocketbase},\rtfsp
533 \helpref{wxSocketClient}{wxsocketclient},\rtfsp
534 \helpref{wxSocketServer}{wxsocketserver}
535
536 \latexignore{\rtfignore{\wxheading{Members}}}
537
538 \membersection{wxSocketEvent::wxSocketEvent}
539
540 \func{}{wxSocketEvent}{\param{int}{ id = 0}}
541
542 Constructor.
543
544 \membersection{wxSocketEvent::SocketEvent}\label{wxsocketeventsocketevent}
545
546 \constfunc{wxSocketBase::wxRequestEvent}{SocketEvent}{\void}
547
548 Returns the socket event type.
549
550 % ---------------------------------------------------------------------------
551 % CLASS: wxSocketHandler
552 % ---------------------------------------------------------------------------
553 \section{\class{wxSocketHandler}}\label{wxsockethandler}
554
555 \wxheading{Derived from}
556
557 \helpref{wxObject}{wxobject}
558
559 % ---------------------------------------------------------------------------
560 % Members
561 % ---------------------------------------------------------------------------
562 \latexignore{\rtfignore{\wxheading{Members}}}
563
564 %
565 % wxSocketHandler
566 %
567 \membersection{wxSocketHandler::wxSocketHandler}
568
569 \func{}{wxSocketHandler}{\void}
570
571 Constructs a new wxSocketHandler.
572
573 It is advised to use \helpref{wxSocketHandler::Master}{wxsockethandlermaster} to
574 get a socket handler. But creating a socket handler is useful to group
575 many sockets.
576
577 %
578 % ~wxSocketHandler
579 %
580 \membersection{wxSocketHandler::\destruct{wxSocketHandler}}
581
582 \func{}{\destruct{wxSocketHandler}}{\void}
583
584 Destructs a wxSocketHandler object.
585
586 %
587 % Register
588 %
589 \membersection{wxSocketHandler::Register}
590
591 \func{void}{Register}{\param{wxSocketBase *}{socket}}
592
593 Register a socket: if it is already registered in this handler it will just
594 return immediately.
595
596 \wxheading{Parameters}
597
598 \docparam{socket}{Socket to be registered.}
599
600 %
601 % UnRegister
602 %
603 \membersection{wxSocketHandler::UnRegister}
604
605 \func{void}{UnRegister}{\param{wxSocketBase *}{socket}}
606
607 UnRegister a socket: if it isn't registered in this handler it will just
608 return.
609
610 \wxheading{Parameters}
611
612 \docparam{socket}{Socket to be unregistered.}
613
614 %
615 % Count
616 %
617 \membersection{wxSocketHandler::Count}
618
619 \constfunc{unsigned long}{Count}{\void}
620
621 Returns the number of sockets registered in the handler.
622
623 \wxheading{Return value}
624
625 Number of sockets registered.
626
627 %
628 % CreateServer
629 %
630 \membersection{wxSocketHandler::CreateServer}
631
632 \func{wxSocketServer *}{CreateServer}{\param{wxSockAddress\&}{ address}, \param{wxSocketBase::wxSockFlags}{ flags = wxSocketbase::NONE}}
633
634 Creates a new wxSocketServer object. The object is automatically registered
635 to the current socket handler.
636 For a detailed description of the parameters, see \helpref{wxSocketServer::wxSocketServer}{wxsocketserverconstr}.
637
638 \wxheading{Return value}
639
640 Returns a new socket server.
641
642 %
643 % CreateClient
644 %
645 \membersection{wxSocketHandler::CreateClient}
646
647 \func{wxSocketServer *}{CreateClient}{\param{wxSocketBase::wxSockFlags}{ flags = wxSocketbase::NONE}}
648
649 Creates a new wxSocketClient object. The object is automatically registered
650 to the current socket handler.
651
652 For a detailed description of the parameters, see \helpref{wxSocketClient::Connect}{wxsocketclientconnect}.
653
654 \wxheading{Return value}
655
656 Returns a new socket client.
657
658 %
659 % Master
660 %
661 \membersection{wxSocketHandler::Master}\label{wxsockethandlermaster}
662
663 \func{static wxSocketHandler\&}{Master}{\void}
664
665 Returns a default socket handler.
666
667 %
668 % Wait
669 %
670 \membersection{wxSocketHandler::Wait}
671
672 \func{int}{Wait}{\param{long}{ seconds},\param{long}{ microseconds}}
673
674 Wait for an event on all registered sockets.
675
676 \wxheading{Parameters}
677
678 \docparam{seconds}{Number of seconds to wait. By default, it waits infinitely.}
679
680 \docparam{microsecond}{Number of microseconds to wait.}
681
682 \wxheading{Return value}
683
684 Returns 0 if a timeout occured, else the number of events detected.
685
686 \wxheading{See also}
687
688 \helpref{wxSocketBase::Wait}{wxsocketbasewait}
689
690 %
691 % YieldSock
692 %
693 \membersection{wxSocketHandler::YieldSock}
694
695 \func{void}{YieldSock}{\void}
696
697 Execute pending requests in all registered sockets.
698
699 % ---------------------------------------------------------------------------
700 % CLASS: wxSocketServer
701 % ---------------------------------------------------------------------------
702 \section{\class{wxSocketServer}}\label{wxsocketserver}
703
704 \wxheading{Derived from}
705
706 \helpref{wxSocketBase}{wxsocketbase}
707
708 % ---------------------------------------------------------------------------
709 % Members
710 % ---------------------------------------------------------------------------
711 \latexignore{\rtfignore{\wxheading{Members}}}
712
713 %
714 % wxSocketServer
715 %
716 \membersection{wxSocketServer::wxSocketServer}\label{wxsocketserverconstr}
717
718 \func{}{wxSocketServer}{\param{wxSockAddress\&}{ address}, \param{wxSockFlags}{ flags = wxSocketBase::NONE}}
719
720 Constructs a new wxSocketServer.
721
722 {\bf Warning !} The created object needs to be registered to a socket handler
723 (see \helpref{wxSocketHandler}{wxsockethandler}).
724
725 \wxheading{Parameters}
726
727 \docparam{address}{Specifies the local address for the server (e.g. port number).}
728
729 \docparam{flags}{Socket flags (See \helpref{wxSocketBase::SetFlags}{wxsocketbasesetflags})}
730
731 %
732 % ~wxSocketServer
733 %
734 \membersection{wxSocketServer::\destruct{wxSocketServer}}
735
736 \func{}{\destruct{wxSocketServer}}{\void}
737
738 Destructs a wxSocketServer object (it doesn't close the accepted connection).
739
740 %
741 % Accept
742 %
743 \membersection{wxSocketServer::Accept}
744
745 \func{wxSocketBase *}{Accept}{\void}
746
747 Creates a new object wxSocketBase and accepts an incoming connection. {\bf Warning !} This function will block the GUI.
748
749 \wxheading{Return value}
750
751 Returns an opened socket connection.
752
753 \wxheading{See also}
754
755 \helpref{wxSocketServer::AcceptWith}{wxsocketserveracceptwith}
756
757 %
758 % AcceptWith
759 %
760 \membersection{wxSocketServer::AcceptWith}\label{wxsocketserveracceptwith}
761
762 \func{bool}{AcceptWith}{\param{wxSocketBase\&}{ socket}}
763
764 Accept an incoming connection using the specified socket object.
765 This is useful when someone wants to inherit wxSocketBase.
766
767 \wxheading{Parameters}
768
769 \docparam{socket}{Socket to be initialized}
770
771 \wxheading{Return value}
772
773 Returns TRUE if no error occurs, else FALSE.
774
775