1 \section{\class{wxSocketBase
}}\label{wxsocketbase
}
3 \wxheading{Derived from
}
5 \helpref{wxEvtHandler
}{wxevthandler
}
7 \wxheading{Include files
}
11 \wxheading{wxSocket errors
}%\label{wxsocketerrs} % Labels don't work on a non-section!
14 \begin{twocollist
}\itemsep=
0pt
15 \twocolitem{{\bf wxSOCKET
\_NOERROR}}{No error happened.
}
16 \twocolitem{{\bf wxSOCKET
\_INVOP}}{Invalid operation.
}
17 \twocolitem{{\bf wxSOCKET
\_IOERR}}{Input/Output error.
}
18 \twocolitem{{\bf wxSOCKET
\_INVADDR}}{Invalid address passed to wxSocket.
}
19 \twocolitem{{\bf wxSOCKET
\_INVSOCK}}{Invalid socket (uninitialized).
}
20 \twocolitem{{\bf wxSOCKET
\_NOHOST}}{No corresponding host.
}
21 \twocolitem{{\bf wxSOCKET
\_INVPORT}}{Invalid port.
}
22 \twocolitem{{\bf wxSOCKET
\_TRYAGAIN}}{The IO call has a timeout or is in non-blocking mode.
}
23 \twocolitem{{\bf wxSOCKET
\_MEMERR}}{Memory exhausted.
}
26 \wxheading{wxSocket events
}
29 \begin{twocollist
}\itemsep=
0pt
30 \twocolitem{{\bf wxSOCKET
\_INPUT}}{Some data are ready to be got.
}
31 \twocolitem{{\bf wxSOCKET
\_OUTPUT}}{The socket is ready to be written to.
}
32 \twocolitem{{\bf wxSOCKET
\_CONNECTION}}{Someone want to connect our server.
}
33 \twocolitem{{\bf wxSOCKET
\_LOST}}{The connection has been broken.
}
34 \twocolitem{{\bf wxSOCKET
\_MAX\_EVENT}}{This should never happen but the compiler may complain about it.
}
37 % ---------------------------------------------------------------------------
39 % ---------------------------------------------------------------------------
40 \wxheading{Event handling
}
42 To process events from a socket, use the following event handler macro to direct
44 functions that take a
\helpref{wxSocketEvent
}{wxsocketevent
} argument.
47 \begin{twocollist
}\itemsep=
0pt
48 \twocolitem{{\bf EVT
\_SOCKET(id, func)
}}{A socket event occured.
}
51 % ---------------------------------------------------------------------------
53 % ---------------------------------------------------------------------------
56 \helpref{wxSocketEvent
}{wxsocketevent
}\\
57 \helpref{wxSocketClient
}{wxsocketclient
}\\
58 \helpref{wxSocketServer
}{wxsocketserver
}
60 % ---------------------------------------------------------------------------
62 % ---------------------------------------------------------------------------
63 \latexignore{\rtfignore{\wxheading{Members
}}}
65 \membersection{wxSocketBase::wxSocketBase
}
67 \func{}{wxSocketBase
}{\void}
69 Default constructor but don't use it, you must use
\helpref{wxSocketClient
}{wxsocketclient
}
70 or
\helpref{wxSocketServer
}{wxsocketserver
}.
72 \membersection{wxSocketBase::
\destruct{wxSocketBase
}}
74 \func{}{\destruct{wxSocketBase
}}{\void}
76 Destroys the wxSocketBase object.
78 % ---------------------------------------------------------------------------
80 % ---------------------------------------------------------------------------
86 \membersection{wxSocketBase::SetFlags
}\label{wxsocketbasesetflags
}
88 \func{void
}{SetFlags
}{\param{wxSocketBase::wxSockFlags
}{ flags
}}
91 \begin{twocollist
}\itemsep=
0pt
92 \twocolitem{{\bf wxSocketBase::NONE
}}{Normal functionnalities.
}
93 \twocolitem{{\bf wxSocketBase::NOWAIT
}}{Get the available data in the input queue and exit immediately.
}
94 \twocolitem{{\bf wxSocketBase::WAITALL
}}{Wait for all required data unless an error occured.
}
95 \twocolitem{{\bf wxSocketBase::SPEED
}}{Disable the asynchronous IO functionnality.
}
101 \membersection{wxSocketBase::SetNotify
}\label{wxsocketbasesetnotify
}
103 \func{void
}{SetNotify
}{\param{wxSocketEventFlags
}{ event_flags
}}
105 SetNotify setups which socket events are to be sent to the event handler.
106 You specify in parameters a mask of wxSocket events. The flags is:
109 \begin{twocollist
}\itemsep=
0pt
110 \twocolitem{{\bf wxSOCKET
\_INPUT\_FLAG}}{to receive wxSOCKET_INPUT
}
111 \twocolitem{{\bf wxSOCKET
\_OUTPUT\_FLAG}}{to receive wxSOCKET_OUTPUT
}
112 \twocolitem{{\bf wxSOCKET
\_CONNECTION\_FLAG}}{to receive wxSOCKET_CONNECTION
}
113 \twocolitem{{\bf wxSOCKET
\_LOST\_FLAG}}{to receive wxSOCKET_LOST
}
118 sock.SetNotify(wxSOCKET
\_INPUT\_FLAG | wxSOCKET
\_LOST\_FLAG);
120 In this example, the user will be notified about incoming socket datas and
123 For more information on socket events see
\helpref{wxSocket events
}{wxsocketbase
}.
128 \membersection{wxSocketBase::SetTimeout
}{wxsocketbasesettimeout
}
130 \func{void
}{SetTimeout
}{\param{int
}{seconds
}}
132 This function sets the socket timeout in seconds.
137 \membersection{wxSocketBase::Notify
}\label{wxsocketbasenotify
}
139 \func{void
}{Notify
}{\param{bool
}{ notify
}}
141 Notify will enable (notify is TRUE) or disable (notify is FALSE) the propagation
148 \membersection{wxSocketBase::Ok
}\label{wxsocketbaseok
}
150 \constfunc{bool
}{Ok
}{\void}
152 Returns TRUE if the socket is initialized and ready and FALSE in other
155 \membersection{wxSocketBase::Error
}\label{wxsocketbaseerror
}
157 \constfunc{bool
}{Error
}{\void}
159 Returns TRUE if an error occured.
161 \membersection{wxSocketBase::IsConnected
}\label{wxsocketbaseconnected
}
163 \constfunc{bool
}{IsConnected
}{\void}
165 Returns TRUE if the socket is connected.
167 \membersection{wxSocketBase::IsData
}\label{wxsocketbaseisdata
}
169 \constfunc{bool
}{IsData
}{\void}
171 Returns TRUE if some data is arrived on the socket.
173 \membersection{wxSocketBase::IsDisconnected
}\label{wxsocketbasedisconnected
}
175 \constfunc{bool
}{IsDisconnected
}{\void}
177 Returns TRUE if the socket is disconnected.
179 \membersection{wxSocketBase::IsNoWait
}\label{wxsocketbasenowait
}
181 \constfunc{bool
}{IsNoWait
}{\void}
183 Returns TRUE if the socket mustn't wait.
185 \membersection{wxSocketBase::LastCount
}\label{wxsocketbaselastcount
}
187 \constfunc{wxUint32
}{LastCount
}{\void}
189 Returns the number of bytes read or written by the last IO call.
191 \membersection{wxSocketBase::LastError
}\label{wxsocketbaselasterror
}
193 \constfunc{wxSocketError
}{LastError
}{\void}
195 Returns the last occured wxSocket error. See
\helpref{wxSocket errors
}{wxsocketbase
}.
197 % ---------------------------------------------------------------------------
199 % ---------------------------------------------------------------------------
203 \membersection{wxSocketBase::Peek
}\label{wxsocketbasepeek
}
205 \func{wxSocketBase\&
}{Peek
}{\param{char *
}{ buffer
},
\param{wxUint32
}{ nbytes
}}
207 This function peeks a buffer of
{\it nbytes
} bytes from the socket. Peeking a buffer
208 doesn't delete it from the system socket in-queue.
210 \wxheading{Parameters
}
212 \docparam{buffer
}{Buffer where to put peeked data.
}
214 \docparam{nbytes
}{Number of bytes.
}
216 \wxheading{Return value
}
218 Returns a reference to the current object.
222 \helpref{wxSocketBase::Error
}{wxsocketbaseerror
}\\
223 \helpref{wxSocketBase::LastCount
}{wxsocketbaselastcount
}\\
224 \helpref{wxSocketBase::LastError
}{wxsocketbaselasterror
}
229 \membersection{wxSocketBase::Read
}\label{wxsocketbaseread
}
231 \func{wxSocketBase\&
}{Read
}{\param{char *
}{ buffer
},
\param{wxUint32
}{ nbytes
}}
233 This function reads a buffer of
{\it nbytes
} bytes from the socket.
235 \wxheading{Parameters
}
237 \docparam{buffer
}{Buffer where to put read data.
}
239 \docparam{nbytes
}{Number of bytes.
}
241 \wxheading{Return value
}
243 Returns a reference to the current object.
245 \wxheading{Remark/Warning
}
247 By default, Read uses an internal asynchronous manager: it will send data when
248 the socket requests them. It is particularly interesting when you enter a long
249 data transfer (e.g. a big file, an image, ...). But it is also buggy when you
250 simply discuss with the peer using user data. In this case, wxSocket prepares
251 itself to send data (Write wait for them to be sent) and during a GUI refresh
252 the user enters new data, which involves a new Read call though the previous
253 isn't finished. Well, in most cases it can work but it might fail too.
254 So I advise you to use the SPEED flag, which disables the asynchronous manager,
255 when you just want to discuss with the peer.
257 This remark is also valid for all IO call.
261 \helpref{wxSocketBase::Error
}{wxsocketbaseerror
},
262 \helpref{wxSocketBase::LastCount
}{wxsocketbaselastcount
},
263 \helpref{wxSocketBase::LastError
}{wxsocketbaselasterror
}
268 \membersection{wxSocketBase::Write
}\label{wxsocketbasewrite
}
270 \func{wxSocketBase\&
}{Write
}{\param{const char *
}{ buffer
},
\param{wxUint32
}{ nbytes
}}
272 This function writes a buffer of
{\it nbytes
} bytes from the socket.
274 \wxheading{Remark/Warning
}
276 By default, Write uses an internal asynchronous manager: it will send data when
277 the socket requests them. It is particularly interesting when you enter a long
278 data transfer (e.g. a big file, an image, ...). But it is also buggy when you
279 simply discuss with the peer using user data. In this case, wxSocket prepares
280 itself to send data (Write wait for them to be sent) and during a GUI refresh
281 the user enters new data, which involves a new Write call though the previous
282 isn't finished. Well, in most cases it can work but it might fail too.
283 So I advise you to use the SPEED flag, which disables the asynchronous manager,
284 when you just want to discuss with the peer.
286 \wxheading{Parameters
}
288 \docparam{buffer
}{Buffer where to get the data to write.
}
290 \docparam{nbytes
}{Number of bytes.
}
292 \wxheading{Return value
}
294 Returns a reference to the current object.
298 \helpref{wxSocketBase::Error
}{wxsocketbaseerror
}\\
299 \helpref{wxSocketBase::LastCount
}{wxsocketbaselastcount
}\\
300 \helpref{wxSocketBase::LastError
}{wxsocketbaselasterror
}
305 \membersection{wxSocketBase::WriteMsg
}\label{wxsocketbasewritemsg
}
307 \func{wxSocketBase\&
}{WriteMsg
}{\param{const char *
}{ buffer
},
\param{wxUint32
}{ nbytes
}}
309 This function writes a buffer of
{\it nbytes
} bytes from the socket. But it
310 writes a short header before so that ReadMsg can alloc the right size for
311 the buffer. So a buffer sent with WriteMsg
{\bf must
} be read with ReadMsg.
313 \wxheading{Parameters
}
315 \docparam{buffer
}{Buffer where to put data peeked.
}
317 \docparam{nbytes
}{Number of bytes.
}
319 \wxheading{Return value
}
321 Returns a reference to the current object.
325 \helpref{wxSocketBase::Error
}{wxsocketbaseerror
}\\
326 \helpref{wxSocketBase::LastCount
}{wxsocketbaselastcount
}\\
327 \helpref{wxSocketBase::LastError
}{wxsocketbaselasterror
}\\
328 \helpref{wxSocketBase::ReadMsg
}{wxsocketbasereadmsg
}
333 \membersection{wxSocketBase::ReadMsg
}\label{wxsocketbasereadmsg
}
335 \func{wxSocketBase\&
}{ReadMsg
}{\param{char *
}{ buffer
},
\param{wxUint32
}{ nbytes
}}
337 This function reads a buffer sent by WriteMsg on a socket. If the buffer passed
338 to the function isn't big enough, the function filled it and then discard the
339 bytes left. This function always wait for the buffer to be entirely filled.
341 \wxheading{Parameters
}
343 \docparam{buffer
}{Buffer where to put read data.
}
345 \docparam{nbytes
}{Number of bytes allocated for the buffer.
}
347 \wxheading{Return value
}
349 Returns a reference to the current object.
353 \helpref{wxSocketBase::Error
}{wxsocketbaseerror
}\\
354 \helpref{wxSocketBase::LastCount
}{wxsocketbaselastcount
}\\
355 \helpref{wxSocketBase::LastError
}{wxsocketbaselasterror
}\\
356 \helpref{wxSocketBase::WriteMsg
}{wxsocketbasewritemsg
}
361 \membersection{wxSocketBase::Unread
}\label{wxsocketbaseunread
}
363 \func{wxSocketBase\&
}{Unread
}{\param{const char *
}{ buffer
},
\param{wxUint32
}{ nbytes
}}
365 This function unreads a buffer. It means that the buffer is put in the top
366 of the incoming queue. But, it is put also at the end of all unread buffers.
367 It is useful for sockets because we can't seek it.
369 \wxheading{Parameters
}
371 \docparam{buffer
}{Buffer to be unread.
}
373 \docparam{nbytes
}{Number of bytes.
}
375 \wxheading{Return value
}
377 Returns a reference to the current object.
381 \helpref{wxSocketBase::Error
}{wxsocketbaseerror
}\\
382 \helpref{wxSocketBase::LastCount
}{wxsocketbaselastcount
}\\
383 \helpref{wxSocketBase::LastError
}{wxsocketbaselasterror
}
388 \membersection{wxSocketBase::Discard
}\label{wxsocketbasediscard
}
390 \func{wxSocketBase\&
}{Discard
}{\void}
392 This function simply deletes all bytes in the incoming queue. This function
395 % ---------------------------------------------------------------------------
397 % ---------------------------------------------------------------------------
398 \membersection{wxSocketBase::Wait
}\label{wxsocketbasewait
}
400 \func{bool
}{Wait
}{\param{long
}{ seconds = -
1},
\param{long
}{ millisecond =
0}}
402 This function waits for an event: it could be an incoming byte, the possibility
403 for the client to write, a lost connection, an incoming connection, an
404 established connection.
406 \wxheading{Parameters
}
408 \docparam{seconds
}{Number of seconds to wait. By default, it waits infinitely.
}
410 \docparam{millisecond
}{Number of milliseconds to wait.
}
412 \wxheading{Return value
}
414 Returns TRUE if an event occured, FALSE if the timeout was reached.
418 \helpref{wxSocketBase::WaitForRead
}{wxsocketbasewaitforread
}\\
419 \helpref{wxSocketBase::WaitForWrite
}{wxsocketbasewaitforwrite
}\\
420 \helpref{wxSocketBase::WaitForLost
}{wxsocketbasewaitforlost
}
425 \membersection{wxSocketBase::WaitForRead
}\label{wxsocketbasewaitforread
}
427 \func{bool
}{WaitForRead
}{\param{long
}{ seconds = -
1},
\param{long
}{ millisecond =
0}}
429 This function waits for a read event.
431 \wxheading{Parameters
}
433 \docparam{seconds
}{Number of seconds to wait. By default, it waits infinitely.
}
435 \docparam{millisecond
}{Number of milliseconds to wait.
}
437 \wxheading{Return value
}
439 Returns TRUE if a byte arrived, FALSE if the timeout was reached.
443 \helpref{wxSocketBase::Wait
}{wxsocketbasewait
}\\
444 \helpref{wxSocketBase::WaitForWrite
}{wxsocketbasewaitforwrite
}\\
445 \helpref{wxSocketBase::WaitForLost
}{wxsocketbasewaitforlost
}
450 \membersection{wxSocketBase::WaitForWrite
}\label{wxsocketbasewaitforwrite
}
452 \func{bool
}{WaitForWrite
}{\param{long
}{ seconds = -
1},
\param{long
}{ millisecond =
0}}
454 This function waits for a write event.
456 \wxheading{Parameters
}
458 \docparam{seconds
}{Number of seconds to wait. By default, it waits infinitely.
}
460 \docparam{millisecond
}{Number of milliseconds to wait.
}
462 \wxheading{Return value
}
464 Returns TRUE if a write event occured, FALSE if the timeout was reached.
468 \helpref{wxSocketBase::Wait
}{wxsocketbasewait
}\\
469 \helpref{wxSocketBase::WaitForRead
}{wxsocketbasewaitforread
}\\
470 \helpref{wxSocketBase::WaitForLost
}{wxsocketbasewaitforlost
}
475 \membersection{wxSocketBase::WaitForLost
}\label{wxsocketbasewaitforlost
}
477 \func{bool
}{Wait
}{\param{long
}{ seconds = -
1},
\param{long
}{ millisecond =
0}}
479 This function waits for a "lost" event. For instance, the peer may have closed
480 the connection, or the connection may have been broken.
482 \wxheading{Parameters
}
484 \docparam{seconds
}{Number of seconds to wait. By default, it waits infinitely.
}
486 \docparam{millisecond
}{Number of milliseconds to wait.
}
488 \wxheading{Return value
}
490 Returns TRUE if a "lost" event occured, FALSE if the timeout was reached.
494 \helpref{wxSocketBase::WaitForRead
}{wxsocketbasewaitforread
}\\
495 \helpref{wxSocketBase::WaitForWrite
}{wxsocketbasewaitforwrite
}\\
496 \helpref{wxSocketBase::WaitForLost
}{wxsocketbasewaitforlost
}
501 \membersection{wxSocketBase::RestoreState
}\label{wxsocketbaserestorestate
}
503 \func{void
}{RestoreState
}{\void}
505 This function restores the previous state of the socket (include flags,
506 notify flags, notify state, C callback function and data).
510 \helpref{wxSocketBase::SaveState
}{wxsocketbasesavestate
}
512 % ---------------------------------------------------------------------------
514 % ---------------------------------------------------------------------------
518 \membersection{wxSocketBase::SaveState
}\label{wxsocketbasesavestate
}
520 \func{void
}{SaveState
}{\void}
522 This function saves the current state of the socket object in a stack:
523 actually it saves all flags and the state of the asynchronous callbacks.
527 \helpref{wxSocketBase::RestoreState
}{wxsocketbaserestorestate
}
532 \membersection{wxSocketBase::GetLocal
}{wxsocketbasegetlocal
}
534 \constfunc{bool
}{GetLocal
}{\param{wxSockAddress\&
}{addr_man
}}
536 This function returns the local address field of the socket. The local
537 address field contains the complete local address of the socket (local
538 address, local port, ...).
540 \wxheading{Return value
}
542 It returns TRUE if no errors happened, FALSE otherwise.
547 \membersection{wxSocketBase::GetPeer
}{wxsocketbasegetlocal
}
549 \constfunc{bool
}{GetPeer
}{\param{wxSockAddress\&
}{addr_man
}}
551 This function returns the peer address field of the socket. The peer
552 address field contains the complete peer host address of the socket
553 (address, port, ...).
555 \wxheading{Return value
}
557 It returns TRUE if no errors happened, FALSE otherwise.
559 % ---------------------------------------------------------------------------
561 % ---------------------------------------------------------------------------
562 \membersection{wxSocketBase::SetEventHandler
}\label{wxsocketbaseseteventhandler
}
564 \func{void
}{SetEventHandler
}{\param{wxEvtHandler\&
}{ evt
\_hdlr},
\param{int
}{ id = -
1}}
566 Sets an event handler to be called when a socket event occured.
568 \wxheading{Parameters
}
570 \docparam{evt
\_hdlr}{Specifies the event handler you want to use.
}
572 \docparam{id
}{The id of socket event.
}
576 \helpref{wxSocketBase::SetNotify
}{wxsocketbasesetnotify
}
577 \helpref{wxSocketBase::Notify
}{wxsocketbasenotify
}
578 \helpref{wxSocketEvent
}{wxsocketevent
}
579 \helpref{wxEvtHandler
}{wxevthandler
}
581 \membersection{wxSocketBase::Callback
}\label{wxsocketbasecallback
}
583 \func{wxSocketBase::wxSockCbk
}{Callback
}{\param{wxSocketBase::wxSockCbk
}{ callback
}}
585 wxSocket event handler can call C callback. This function allows you to set it.
586 The format of the callback is as followed:
588 void SocketCallback(wxSocketBase& sock,wxSocketNotify evt,char *cdata);
591 The first parameter reminds you of the caller socket. The second parameter
592 informs you about the current event (See
\helpref{wxSocket events
}{wxsocketbase
}).
593 The third parameters is the client data you specified using
\helpref{CallbackData
}{wxsocketcallbackdata
}.
595 \wxheading{Return value
}
597 It returns the previous callback.
601 \helpref{wxSocketBase::SetNotify
}{wxsocketbasesetnotify
}
602 \helpref{wxSocketBase::Notify
}{wxsocketbasenotify
}
604 \membersection{wxSocketBase::CallbackData
}\label{wxsocketcallbackdata
}
606 \func{char *
}{CallbackData
}{\param{char *
}{cdata
}}
608 This function sets the the client data which will be passed to a
\helpref{C callback
}{wxsocketbasecallback
}.
610 \wxheading{Return value
}
612 This function returns the old value of the client data pointer.
614 % ---------------------------------------------------------------------------
615 % CLASS wxSocketClient
616 % ---------------------------------------------------------------------------
617 \section{\class{wxSocketClient
}}\label{wxsocketclient
}
619 \wxheading{Derived from
}
621 \helpref{wxSocketBase
}{wxsocketbase
}
623 \wxheading{Include files
}
627 % ---------------------------------------------------------------------------
629 % ---------------------------------------------------------------------------
633 \membersection{wxSocketClient::wxSocketClient
}
635 \func{}{wxSocketClient
}{\param{wxSockFlags
}{ flags = wxSocketBase::NONE
}}
637 Constructs a new wxSocketClient.
639 \wxheading{Parameters
}
641 \docparam{flags
}{Socket flags (See
\helpref{wxSocketBase::SetFlags
}{wxsocketbasesetflags
})
}
646 \membersection{wxSocketClient::
\destruct{wxSocketClient
}}
648 \func{}{\destruct{wxSocketClient
}}{\void}
650 Destroys a wxSocketClient object.
655 \membersection{wxSocketClient::Connect
}\label{wxsocketclientconnect
}
657 \func{bool
}{Connect
}{\param{wxSockAddress\&
}{ address
},
\param{bool
}{ wait = TRUE
}}
659 Connects to a server using the specified address. If
{\it wait
} is TRUE, Connect
660 will wait for the socket ready to send or receive data.
662 \wxheading{Parameters
}
664 \docparam{address
}{Address of the server.
}
666 \docparam{wait
}{If true, waits for the connection to be ready.
}
668 \wxheading{Return value
}
670 Returns TRUE if the connection is established and no error occurs.
674 \helpref{wxSocketClient::WaitOnConnect
}{wxsocketclientwaitonconnect
}
679 \membersection{wxSocketClient::WaitOnConnect
}\label{wxsocketclientwaitonconnect
}
681 \func{bool
}{WaitOnConnect
}{\param{long
}{ seconds = -
1},
\param{long
}{ milliseconds =
0}}
683 Wait for a "connect" event.
687 \helpref{wxSocketBase::Wait
}{wxsocketbasewait
} for a detailed description.
689 % ---------------------------------------------------------------------------
690 % CLASS: wxSocketEvent
691 % ---------------------------------------------------------------------------
692 \section{\class{wxSocketEvent
}}\label{wxsocketevent
}
694 This event class contains information about socket events.
696 \wxheading{Derived from
}
698 \helpref{wxEvent
}{wxevent
}
700 \wxheading{Include files
}
704 \wxheading{Event table macros
}
706 To process a socket event, use these event handler macros to direct input to member
707 functions that take a wxSocketEvent argument.
710 \begin{twocollist
}\itemsep=
0pt
711 \twocolitem{{\bf EVT
\_SOCKET(id, func)
}}{Process a socket event, supplying the member function.
}
716 \helpref{wxSocketBase
}{wxsocketbase
},
\rtfsp
717 \helpref{wxSocketClient
}{wxsocketclient
},
\rtfsp
718 \helpref{wxSocketServer
}{wxsocketserver
}
720 \latexignore{\rtfignore{\wxheading{Members
}}}
722 \membersection{wxSocketEvent::wxSocketEvent
}
724 \func{}{wxSocketEvent
}{\param{int
}{ id =
0}}
728 \membersection{wxSocketEvent::SocketEvent
}\label{wxsocketeventsocketevent
}
730 \constfunc{wxSocketNotify
}{SocketEvent
}{\void}
732 Returns the socket event type.
734 % ---------------------------------------------------------------------------
735 % CLASS: wxSocketServer
736 % ---------------------------------------------------------------------------
737 \section{\class{wxSocketServer
}}\label{wxsocketserver
}
739 \wxheading{Derived from
}
741 \helpref{wxSocketBase
}{wxsocketbase
}
743 \wxheading{Include files
}
747 % ---------------------------------------------------------------------------
749 % ---------------------------------------------------------------------------
750 \latexignore{\rtfignore{\wxheading{Members
}}}
755 \membersection{wxSocketServer::wxSocketServer
}\label{wxsocketserverconstr
}
757 \func{}{wxSocketServer
}{\param{wxSockAddress\&
}{ address
},
\param{wxSockFlags
}{ flags = wxSocketBase::NONE
}}
759 Constructs a new wxSocketServer.
761 \wxheading{Parameters
}
763 \docparam{address
}{Specifies the local address for the server (e.g. port number).
}
765 \docparam{flags
}{Socket flags (See
\helpref{wxSocketBase::SetFlags
}{wxsocketbasesetflags
})
}
770 \membersection{wxSocketServer::
\destruct{wxSocketServer
}}
772 \func{}{\destruct{wxSocketServer
}}{\void}
774 Destroys a wxSocketServer object (it doesn't close the accepted connection).
779 \membersection{wxSocketServer::Accept
}
781 \func{wxSocketBase *
}{Accept
}{\void}
783 Creates a new object wxSocketBase and accepts an incoming connection.
{\bf Warning !
} This function will block the GUI.
785 \wxheading{Return value
}
787 Returns an opened socket connection.
791 \helpref{wxSocketServer::AcceptWith
}{wxsocketserveracceptwith
}
796 \membersection{wxSocketServer::AcceptWith
}\label{wxsocketserveracceptwith
}
798 \func{bool
}{AcceptWith
}{\param{wxSocketBase\&
}{ socket
}}
800 Accept an incoming connection using the specified socket object.
801 This is useful when someone wants to inherit wxSocketBase.
803 \wxheading{Parameters
}
805 \docparam{socket
}{Socket to be initialized
}
807 \wxheading{Return value
}
809 Returns TRUE if no error occurs, else FALSE.