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