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