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