File: wx209.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (484 lines) | stat: -rw-r--r-- 17,364 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
<HTML>
<head><title>wxSocketBase</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxsocketbase"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx208.htm#wxsockaddress"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx210.htm#wxsocketclient"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxSocketBase</H2>
<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/socket.h&gt;<P>
<B><FONT COLOR="#FF0000">Event handling</FONT></B><P>
To process events from a socket, use the following event handler macro to direct
 input to member
functions that take a <A HREF="wx211.htm#wxsocketevent">wxSocketEvent</A> argument.<P>

<TABLE>


<TR><TD VALIGN=TOP>
<B>EVT_SOCKET(id, func)</B>
</TD>

<TD VALIGN=TOP>
A socket event occured.
</TD></TR>


</TABLE>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx211.htm#wxsocketevent">wxSocketEvent</A><BR>

<A HREF="wx210.htm#wxsocketclient">wxSocketClient</A><BR>

<A HREF="wx213.htm#wxsocketserver">wxSocketServer</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#topic825">wxSocketBase::wxSocketBase</A><BR>
<A HREF="#topic826">wxSocketBase::~wxSocketBase</A><BR>
<A HREF="#wxsocketbaseok">wxSocketBase::Ok</A><BR>
<A HREF="#wxsocketbaseerror">wxSocketBase::Error</A><BR>
<A HREF="#wxsocketbaseconnected">wxSocketBase::IsConnected</A><BR>
<A HREF="#wxsocketbaseisdata">wxSocketBase::IsData</A><BR>
<A HREF="#wxsocketbasedisconnected">wxSocketBase::IsDisconnected</A><BR>
<A HREF="#wxsocketbasenowait">wxSocketBase::IsNoWait</A><BR>
<A HREF="#wxsocketbaselastcount">wxSocketBase::LastCount</A><BR>
<A HREF="#wxsocketbaselasterror">wxSocketBase::LastError</A><BR>
<A HREF="#wxsocketbasepeek">wxSocketBase::Peek</A><BR>
<A HREF="#wxsocketbaseread">wxSocketBase::Read</A><BR>
<A HREF="#wxsocketbasesetflags">wxSocketBase::SetFlags</A><BR>
<A HREF="#wxsocketbasewrite">wxSocketBase::Write</A><BR>
<A HREF="#wxsocketbasewritemsg">wxSocketBase::WriteMsg</A><BR>
<A HREF="#wxsocketbasereadmsg">wxSocketBase::ReadMsg</A><BR>
<A HREF="#wxsocketbaseunread">wxSocketBase::UnRead</A><BR>
<A HREF="#wxsocketbasediscard">wxSocketBase::Discard</A><BR>
<A HREF="#wxsocketbasewait">wxSocketBase::Wait</A><BR>
<A HREF="#wxsocketbasewaitforread">wxSocketBase::WaitForRead</A><BR>
<A HREF="#wxsocketbasewaitforwrite">wxSocketBase::WaitForWrite</A><BR>
<A HREF="#wxsocketbasewaitforlost">wxSocketBase::WaitForLost</A><BR>
<A HREF="#wxsocketbaserestorestate">wxSocketBase::RestoreState</A><BR>
<A HREF="#wxsocketbasesavestate">wxSocketBase::SaveState</A><BR>
<A HREF="#wxsocketbaseseteventhandler">wxSocketBase::SetEventHandler</A><BR>
<P>

<HR>
<A NAME="topic825"></A>
<H3>wxSocketBase::wxSocketBase</H3>
<P>
<B></B> <B>wxSocketBase</B>()<P>
Default constructor but don't use it, you must use <A HREF="wx210.htm#wxsocketclient">wxSocketClient</A>
or <A HREF="wx213.htm#wxsocketserver">wxSocketServer</A>.<P>

<HR>
<A NAME="topic826"></A>
<H3>wxSocketBase::~wxSocketBase</H3>
<P>
<B></B> <B>~wxSocketBase</B>()<P>
Destroys the wxSocketBase object.<P>

<HR>
<A NAME="wxsocketbaseok"></A>
<H3>wxSocketBase::Ok</H3>
<P>
<B>bool</B> <B>Ok</B>() <B>const</B><P>
Returns TRUE if the socket is initialized and ready and FALSE in other
cases.<P>

<HR>
<A NAME="wxsocketbaseerror"></A>
<H3>wxSocketBase::Error</H3>
<P>
<B>bool</B> <B>Error</B>() <B>const</B><P>
Returns TRUE if an error occured.<P>

<HR>
<A NAME="wxsocketbaseconnected"></A>
<H3>wxSocketBase::IsConnected</H3>
<P>
<B>bool</B> <B>IsConnected</B>() <B>const</B><P>
Returns TRUE if the socket is connected.<P>

<HR>
<A NAME="wxsocketbaseisdata"></A>
<H3>wxSocketBase::IsData</H3>
<P>
<B>bool</B> <B>IsData</B>() <B>const</B><P>
Returns TRUE if some data is arrived on the socket. <P>

<HR>
<A NAME="wxsocketbasedisconnected"></A>
<H3>wxSocketBase::IsDisconnected</H3>
<P>
<B>bool</B> <B>IsDisconnected</B>() <B>const</B><P>
Returns TRUE if the socket is disconnected.<P>

<HR>
<A NAME="wxsocketbasenowait"></A>
<H3>wxSocketBase::IsNoWait</H3>
<P>
<B>bool</B> <B>IsNoWait</B>() <B>const</B><P>
Returns TRUE if the socket mustn't wait.<P>

<HR>
<A NAME="wxsocketbaselastcount"></A>
<H3>wxSocketBase::LastCount</H3>
<P>
<B>size_t</B> <B>LastCount</B>() <B>const</B><P>
Returns the number of bytes read or written by the last IO call.<P>

<HR>
<A NAME="wxsocketbaselasterror"></A>
<H3>wxSocketBase::LastError</H3>
<P>
<B>int</B> <B>LastError</B>() <B>const</B><P>
Returns an error in the errno format (see your C programmer's guide).<P>

<HR>
<A NAME="wxsocketbasepeek"></A>
<H3>wxSocketBase::Peek</H3>
<P>
<B>wxSocketBase&amp;</B> <B>Peek</B>(<B>char *</B><I> buffer</I>, <B>size_t</B><I> nbytes</I>)<P>
This function peeks a buffer of <I>nbytes</I> bytes from the socket. Peeking a buffer
doesn't delete it from the system socket in-queue.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>buffer</I><UL><UL>
Buffer where to put peeked data.</UL></UL>
<P>
<I>nbytes</I><UL><UL>
Number of bytes.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns a reference to the current object.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaseerror">wxSocketBase::Error</A><BR>

<A HREF="wx209.htm#wxsocketbaselastcount">wxSocketBase::LastCount</A><BR>

<A HREF="wx209.htm#wxsocketbaselasterror">wxSocketBase::LastError</A><P>

<HR>
<A NAME="wxsocketbaseread"></A>
<H3>wxSocketBase::Read</H3>
<P>
<B>wxSocketBase&amp;</B> <B>Read</B>(<B>char *</B><I> buffer</I>, <B>size_t</B><I> nbytes</I>)<P>
This function reads a buffer of <I>nbytes</I> bytes from the socket.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>buffer</I><UL><UL>
Buffer where to put read data.</UL></UL>
<P>
<I>nbytes</I><UL><UL>
Number of bytes.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns a reference to the current object.<P>
<B><FONT COLOR="#FF0000">Remark/Warning</FONT></B><P>
By default, Read uses an internal asynchronous manager: it will send data when
the socket requests them. It is particularly interesting when you enter a long
data transfer (e.g. a big file, an image, ...). But it is also buggy when you
simply discuss with the peer using user data. In this case, wxSocket prepares
itself to send data (Write wait for them to be sent) and during a GUI refresh
the user enters new data, which involves a new Read call though the previous
isn't finished. Well, in most cases it can work but it might fail too.
So I advise you to use the SPEED flag, which disables the asynchronous manager,
when you just want to discuss with the peer.<P>
This remark is also valid for all IO call.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaseerror">wxSocketBase::Error</A>,
 <A HREF="wx209.htm#wxsocketbaselastcount">wxSocketBase::LastCount</A>,
 <A HREF="wx209.htm#wxsocketbaselasterror">wxSocketBase::LastError</A>
 

<HR>
<A NAME="wxsocketbasesetflags"></A>
<H3>wxSocketBase::SetFlags</H3>
<P>
<B>void</B> <B>SetFlags</B>(<B>wxSockFlags</B><I> flags</I>)<P>


<TABLE>


<TR><TD VALIGN=TOP>
<B>wxSocketBase::NONE</B>
</TD>

<TD VALIGN=TOP>
Normal functionnalities.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSocketBase::NOWAIT</B>
</TD>

<TD VALIGN=TOP>
Get the available data in the input queue and exit immediately.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSocketBase::WAITALL</B>
</TD>

<TD VALIGN=TOP>
Wait for all required data unless an error occured.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSocketBase::SPEED</B>
</TD>

<TD VALIGN=TOP>
Disable the asynchronous IO functionnality.
</TD></TR>


</TABLE>
<P>

<HR>
<A NAME="wxsocketbasewrite"></A>
<H3>wxSocketBase::Write</H3>
<P>
<B>wxSocketBase&amp;</B> <B>Write</B>(<B>const char *</B><I> buffer</I>, <B>size_t</B><I> nbytes</I>)<P>
This function writes a buffer of <I>nbytes</I> bytes from the socket.<P>
<B><FONT COLOR="#FF0000">Remark/Warning</FONT></B><P>
By default, Write uses an internal asynchronous manager: it will send data when
the socket requests them. It is particularly interesting when you enter a long
data transfer (e.g. a big file, an image, ...). But it is also buggy when you
simply discuss with the peer using user data. In this case, wxSocket prepares
itself to send data (Write wait for them to be sent) and during a GUI refresh
the user enters new data, which involves a new Write call though the previous
isn't finished. Well, in most cases it can work but it might fail too.  
So I advise you to use the SPEED flag, which disables the asynchronous manager,
when you just want to discuss with the peer.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>buffer</I><UL><UL>
Buffer where to get the data to write.</UL></UL>
<P>
<I>nbytes</I><UL><UL>
Number of bytes.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns a reference to the current object.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaseerror">wxSocketBase::Error</A><BR>

<A HREF="wx209.htm#wxsocketbaselastcount">wxSocketBase::LastCount</A><BR>

<A HREF="wx209.htm#wxsocketbaselasterror">wxSocketBase::LastError</A><P>

<HR>
<A NAME="wxsocketbasewritemsg"></A>
<H3>wxSocketBase::WriteMsg</H3>
<P>
<B>wxSocketBase&amp;</B> <B>WriteMsg</B>(<B>const char *</B><I> buffer</I>, <B>size_t</B><I> nbytes</I>)<P>
This function writes a buffer of <I>nbytes</I> bytes from the socket. But it
writes a short header before so that ReadMsg can alloc the right size for
the buffer. So a buffer sent with WriteMsg <B>must</B> be read with ReadMsg.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>buffer</I><UL><UL>
Buffer where to put data peeked.</UL></UL>
<P>
<I>nbytes</I><UL><UL>
Number of bytes.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns a reference to the current object.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaseerror">wxSocketBase::Error</A><BR>

<A HREF="wx209.htm#wxsocketbaselastcount">wxSocketBase::LastCount</A><BR>

<A HREF="wx209.htm#wxsocketbaselasterror">wxSocketBase::LastError</A><BR>

<A HREF="wx209.htm#wxsocketbasereadmsg">wxSocketBase::ReadMsg</A><P>

<HR>
<A NAME="wxsocketbasereadmsg"></A>
<H3>wxSocketBase::ReadMsg</H3>
<P>
<B>wxSocketBase&amp;</B> <B>ReadMsg</B>(<B>char *</B><I> buffer</I>, <B>size_t</B><I> nbytes</I>)<P>
This function reads a buffer sent by WriteMsg on a socket. If the buffer passed
to the function isn't big enough, the function filled it and then discard the
bytes left. This function always wait for the buffer to be entirely filled.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>buffer</I><UL><UL>
Buffer where to put read data.</UL></UL>
<P>
<I>nbytes</I><UL><UL>
Number of bytes allocated for the buffer.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns a reference to the current object.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaseerror">wxSocketBase::Error</A><BR>

<A HREF="wx209.htm#wxsocketbaselastcount">wxSocketBase::LastCount</A><BR>

<A HREF="wx209.htm#wxsocketbaselasterror">wxSocketBase::LastError</A><BR>

<A HREF="wx209.htm#wxsocketbasewritemsg">wxSocketBase::WriteMsg</A><P>

<HR>
<A NAME="wxsocketbaseunread"></A>
<H3>wxSocketBase::UnRead</H3>
<P>
<B>wxSocketBase&amp;</B> <B>UnRead</B>(<B>const char *</B><I> buffer</I>, <B>size_t</B><I> nbytes</I>)<P>
This function unreads a buffer. It means that the buffer is put in the top
of the incoming queue. But, it is put also at the end of all unread buffers.
It is useful for sockets because we can't seek it.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>buffer</I><UL><UL>
Buffer to be unread.</UL></UL>
<P>
<I>nbytes</I><UL><UL>
Number of bytes.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns a reference to the current object.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaseerror">wxSocketBase::Error</A><BR>

<A HREF="wx209.htm#wxsocketbaselastcount">wxSocketBase::LastCount</A><BR>

<A HREF="wx209.htm#wxsocketbaselasterror">wxSocketBase::LastError</A><P>

<HR>
<A NAME="wxsocketbasediscard"></A>
<H3>wxSocketBase::Discard</H3>
<P>
<B>wxSocketBase&amp;</B> <B>Discard</B>()<P>
This function simply deletes all bytes in the incoming queue. This function
doesn't wait.<P>

<HR>
<A NAME="wxsocketbasewait"></A>
<H3>wxSocketBase::Wait</H3>
<P>
<B>bool</B> <B>Wait</B>(<B>long</B><I> seconds = -1</I>, <B>long</B><I> microsecond = 0</I>)<P>
This function waits for an event: it could be an incoming byte, the possibility
for the client to write, a lost connection, an incoming connection, an
established connection.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>seconds</I><UL><UL>
Number of seconds to wait. By default, it waits infinitely.</UL></UL>
<P>
<I>microsecond</I><UL><UL>
Number of microseconds to wait.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns TRUE if an event occured, FALSE if the timeout was reached.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbasewaitforread">wxSocketBase::WaitForRead</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforwrite">wxSocketBase::WaitForWrite</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforlost">wxSocketBase::WaitForLost</A><P>

<HR>
<A NAME="wxsocketbasewaitforread"></A>
<H3>wxSocketBase::WaitForRead</H3>
<P>
<B>bool</B> <B>WaitForRead</B>(<B>long</B><I> seconds = -1</I>, <B>long</B><I> microsecond = 0</I>)<P>
This function waits for a read event.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>seconds</I><UL><UL>
Number of seconds to wait. By default, it waits infinitely.</UL></UL>
<P>
<I>microsecond</I><UL><UL>
Number of microseconds to wait.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns TRUE if a byte arrived, FALSE if the timeout was reached.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbasewait">wxSocketBase::Wait</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforwrite">wxSocketBase::WaitForWrite</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforlost">wxSocketBase::WaitForLost</A><P>

<HR>
<A NAME="wxsocketbasewaitforwrite"></A>
<H3>wxSocketBase::WaitForWrite</H3>
<P>
<B>bool</B> <B>WaitForWrite</B>(<B>long</B><I> seconds = -1</I>, <B>long</B><I> microsecond = 0</I>)<P>
This function waits for a write event.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>seconds</I><UL><UL>
Number of seconds to wait. By default, it waits infinitely.</UL></UL>
<P>
<I>microsecond</I><UL><UL>
Number of microseconds to wait.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns TRUE if a write event occured, FALSE if the timeout was reached.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbasewait">wxSocketBase::Wait</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforread">wxSocketBase::WaitForRead</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforlost">wxSocketBase::WaitForLost</A><P>

<HR>
<A NAME="wxsocketbasewaitforlost"></A>
<H3>wxSocketBase::WaitForLost</H3>
<P>
<B>bool</B> <B>Wait</B>(<B>long</B><I> seconds = -1</I>, <B>long</B><I> microsecond = 0</I>)<P>
This function waits for a "lost" event. For instance, the peer may have closed
the connection, or the connection may have been broken.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>seconds</I><UL><UL>
Number of seconds to wait. By default, it waits infinitely.</UL></UL>
<P>
<I>microsecond</I><UL><UL>
Number of microseconds to wait.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
Returns TRUE if a "lost" event occured, FALSE if the timeout was reached.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbasewaitforread">wxSocketBase::WaitForRead</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforwrite">wxSocketBase::WaitForWrite</A><BR>

<A HREF="wx209.htm#wxsocketbasewaitforlost">wxSocketBase::WaitForLost</A><P>

<HR>
<A NAME="wxsocketbaserestorestate"></A>
<H3>wxSocketBase::RestoreState</H3>
<P>
<B>void</B> <B>RestoreState</B>()<P>
This function restores a previously saved state.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbasesavestate">wxSocketBase::SaveState</A><P>

<HR>
<A NAME="wxsocketbasesavestate"></A>
<H3>wxSocketBase::SaveState</H3>
<P>
<B>void</B> <B>SaveState</B>()<P>
This function saves the current state of the socket object in a stack:
actually it saves all flags and the state of the asynchronous callbacks. <P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx209.htm#wxsocketbaserestorestate">wxSocketBase::RestoreState</A><P>

<HR>
<A NAME="wxsocketbaseseteventhandler"></A>
<H3>wxSocketBase::SetEventHandler</H3>
<P>
<B>void</B> <B>SetEventHandler</B>(<B>wxEvtHandler&amp;</B><I> evt_hdlr</I>, <B>int</B><I> id = -1</I>)<P>
Sets an event handler to be called when a socket event occured.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>evt_hdlr</I><UL><UL>
Specifies the event handler you want to use.</UL></UL>
<P>
<I>id</I><UL><UL>
The id of socket event.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx211.htm#wxsocketevent">wxSocketEvent</A><P>

</BODY></HTML>