]>
git.saurik.com Git - wxWidgets.git/blob - interface/socket.h
d57b844f1fb06098e82d654a0cf7038a6adda270
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxIPV4address class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
17 class wxIPV4address
: public wxIPaddress
21 Set address to any of the addresses of the current machine. Whenever
22 possible, use this function instead of LocalHost(),
23 as this correctly handles multi-homed hosts and avoids other small
24 problems. Internally, this is the same as setting the IP address
27 @returns Returns @true on success, @false if something went wrong.
33 Returns the hostname which matches the IP address.
35 bool Hostname(const wxString
& hostname
);
36 Return value wxString
Hostname();
40 Returns a wxString containing the IP address in dot quad (127.0.0.1) format.
45 Set address to localhost (127.0.0.1). Whenever possible, use the
47 function instead of this one, as this will correctly handle multi-homed
48 hosts and avoid other small problems.
54 Returns the current service.
56 bool Service(const wxString
& service
);
57 Return value
bool Service(unsigned short service
);
58 Return value
unsigned short Service();
72 wxSocketServer::WaitForAccept, wxSocketBase::SetNotify, wxSocketBase::Notify,
73 wxSocketServer::AcceptWith
75 class wxSocketServer
: public wxSocketBase
79 Constructs a new server and tries to bind to the specified @e address.
80 Before trying to accept new connections, test whether it succeeded with
81 @ref wxSocketBase::isok wxSocketBase:IsOk.
84 Specifies the local address for the server (e.g. port number).
87 Socket flags (See wxSocketBase::SetFlags)
89 wxSocketServer(const wxSockAddress
& address
,
90 wxSocketFlags flags
= wxSOCKET_NONE
);
93 Destructor (it doesn't close the accepted connections).
98 Accepts an incoming connection request, and creates a new
99 wxSocketBase object which represents
100 the server-side of the connection.
102 If @e wait is @true and there are no pending connections to be
103 accepted, it will wait for the next incoming connection to
104 arrive. @b Warning: This will block the GUI.
106 If @e wait is @false, it will try to accept a pending connection
107 if there is one, but it will always return immediately without blocking
108 the GUI. If you want to use Accept in this way, you can either check for
109 incoming connections with WaitForAccept()
110 or catch @b wxSOCKET_CONNECTION events, then call Accept once you know
111 that there is an incoming connection waiting to be accepted.
113 @returns Returns an opened socket connection, or @NULL if an error
114 occurred or if the wait parameter was @false and there
115 were no pending connections.
117 @sa WaitForAccept(), wxSocketBase::SetNotify,
118 wxSocketBase::Notify, AcceptWith()
120 wxSocketBase
* Accept(bool wait
= @
true);
123 Accept an incoming connection using the specified socket object.
126 Socket to be initialized
128 @returns Returns @true on success, or @false if an error occurred or if the
129 wait parameter was @false and there were no pending
132 bool AcceptWith(wxSocketBase
& socket
, bool wait
= @
true);
135 This function waits for an incoming connection. Use it if you want to call
136 Accept() or AcceptWith()
137 with @e wait set to @false, to detect when an incoming connection is waiting
141 Number of seconds to wait.
142 If -1, it will wait for the default timeout,
143 as set with SetTimeout.
146 Number of milliseconds to wait.
148 @returns Returns @true if an incoming connection arrived, @false if the
151 bool WaitForAccept(long seconds
= -1, long millisecond
= 0);
159 wxIPaddress is an abstract base class for all internet protocol address
160 objects. Currently, only wxIPV4address
161 is implemented. An experimental implementation for IPV6, wxIPV6address,
167 class wxIPaddress
: public wxSockAddress
171 Internally, this is the same as setting the IP address
174 On IPV4 implementations, 0.0.0.0
176 On IPV6 implementations, ::
178 @returns Returns @true on success, @false if something went wrong.
180 virtual bool AnyAddress();
183 Internally, this is the same as setting the IP address
184 to @b INADDR_BROADCAST.
186 On IPV4 implementations, 255.255.255.255
188 @returns Returns @true on success, @false if something went wrong.
190 virtual bool BroadcastAddress();
194 Returns the hostname which matches the IP address.
196 virtual bool Hostname(const wxString
& hostname
);
197 Return value
virtual wxString
Hostname();
201 Returns a wxString containing the IP address.
203 virtual wxString
IPAddress();
206 Determines if current address is set to localhost.
208 virtual bool IsLocalHost();
211 Set address to localhost.
213 On IPV4 implementations, 127.0.0.1
215 On IPV6 implementations, ::1
217 @returns Returns @true on success, @false if something went wrong.
219 virtual bool LocalHost();
223 Returns the current service.
225 virtual bool Service(const wxString
& service
);
226 Return value
virtual bool Service(unsigned short service
);
227 Return value
virtual unsigned short Service();
233 @class wxSocketClient
241 wxSocketClient::WaitOnConnect, wxSocketBase::SetNotify, wxSocketBase::Notify
243 class wxSocketClient
: public wxSocketBase
250 Socket flags (See wxSocketBase::SetFlags)
252 wxSocketClient(wxSocketFlags flags
= wxSOCKET_NONE
);
255 Destructor. Please see wxSocketBase::Destroy.
261 Connects to a server using the specified address.
263 If @e wait is @true, Connect will wait until the connection
264 completes. @b Warning: This will block the GUI.
266 If @e wait is @false, Connect will try to establish the connection and
267 return immediately, without blocking the GUI. When used this way, even if
268 Connect returns @false, the connection request can be completed later.
269 To detect this, use WaitOnConnect(),
270 or catch @b wxSOCKET_CONNECTION events (for successful establishment)
271 and @b wxSOCKET_LOST events (for connection failure).
274 Address of the server.
277 Bind to the specified local address and port before connecting.
278 The local address and port can also be set using SetLocal,
279 and then using the 2-parameter Connect method.
282 If @true, waits for the connection to complete.
284 @returns Returns @true if the connection is established and no error
287 @sa WaitOnConnect(), wxSocketBase::SetNotify,
290 bool Connect(wxSockAddress
& address
, bool wait
= @
true);
291 bool Connect(wxSockAddress
& address
, wxSockAddress
& local
,
296 Wait until a connection request completes, or until the specified timeout
297 elapses. Use this function after issuing a call
298 to Connect() with @e wait set to @false.
301 Number of seconds to wait.
302 If -1, it will wait for the default timeout,
303 as set with SetTimeout.
306 Number of milliseconds to wait.
308 @returns WaitOnConnect returns @true if the connection request completes.
309 This does not necessarily mean that the connection
310 was successfully established; it might also happen
311 that the connection was refused by the peer. Use
312 IsConnected to distinguish between these two
315 bool WaitOnConnect(long seconds
= -1, long milliseconds
= 0);
323 You are unlikely to need to use this class: only wxSocketBase uses it.
329 wxSocketBase, wxIPaddress, wxIPV4address
331 class wxSockAddress
: public wxObject
345 Delete all informations about the address.
350 Returns the length of the socket address.
360 This event class contains information about socket events.
366 wxSocketBase, wxSocketClient, wxSocketServer
368 class wxSocketEvent
: public wxEvent
374 wxSocketEvent(int id
= 0);
377 Gets the client data of the socket which generated this event, as
378 set with wxSocketBase::SetClientData.
380 void * GetClientData();
383 Returns the socket object to which this event refers to. This makes
384 it possible to use the same event handler for different sockets.
386 wxSocketBase
* GetSocket();
389 Returns the socket event type.
391 wxSocketNotify
GetSocketEvent();
399 wxSocketBase is the base class for all socket-related objects, and it
400 defines all basic IO functionality.
402 Note: (Workaround for implementation limitation for wxWidgets up to 2.5.x)
403 If you want to use sockets or derived classes such as wxFTP in a secondary
405 call wxSocketBase::Initialize() (undocumented) from the main thread before
407 any sockets - in wxApp::OnInit for example.
408 See http://wiki.wxwidgets.org/wiki.pl?WxSocket or
409 http://www.litwindow.com/knowhow/knowhow.html for more details.
415 wxSocketEvent, wxSocketClient, wxSocketServer, @ref overview_samplesockets
418 class wxSocketBase
: public wxObject
422 Default constructor. Don't use it directly; instead, use
423 wxSocketClient to construct a socket client, or
424 wxSocketServer to construct a socket server.
429 Destructor. Do not destroy a socket using the delete operator directly;
430 use Destroy() instead. Also, do not create
431 socket objects in the stack.
436 Functions that perform basic IO functionality.
454 Functions that perform a timed wait on a certain IO condition.
467 wxSocketServer::WaitForAccept
469 wxSocketClient::WaitOnConnect
471 Functions that allow applications to customize socket IO as needed.
484 This function shuts down the socket, disabling further transmission and
485 reception of data; it also disables events for the socket and frees the
486 associated system resources. Upon socket destruction, Close is automatically
487 called, so in most cases you won't need to do it yourself, unless you
488 explicitly want to shut down the socket, typically to notify the peer
489 that you are closing the connection.
494 @ref construct() wxSocketBase
496 @ref destruct() ~wxSocketBase
503 Destroys the socket safely. Use this function instead of the delete operator,
504 since otherwise socket events could reach the application even after the
505 socket has been destroyed. To prevent this problem, this function appends
506 the wxSocket to a list of object to be deleted on idle time, after all
507 events have been processed. For the same reason, you should avoid creating
508 socket objects in the stack.
510 Destroy calls Close() automatically.
512 @returns Always @true.
517 This function simply deletes all bytes in the incoming queue. This function
518 always returns immediately and its operation is not affected by IO flags.
520 Use LastCount() to verify the number of bytes actually discarded.
522 If you use Error(), it will always return @false.
524 wxSocketBase
Discard();
527 Returns @true if an error occurred in the last IO operation.
529 Use this function to check for an error condition after one of the
530 following calls: Discard, Peek, Read, ReadMsg, Unread, Write, WriteMsg.
535 Returns a pointer of the client data for this socket, as set with
538 void * GetClientData();
541 Returns current IO flags, as set with SetFlags()
543 wxSocketFlags
GetFlags();
546 This function returns the local address field of the socket. The local
547 address field contains the complete local address of the socket (local
548 address, local port, ...).
550 @returns @true if no error happened, @false otherwise.
552 bool GetLocal(wxSockAddress
& addr
);
555 This function returns the peer address field of the socket. The peer
556 address field contains the complete peer host address of the socket
557 (address, port, ...).
559 @returns @true if no error happened, @false otherwise.
561 bool GetPeer(wxSockAddress
& addr
);
564 Functions that allow applications to receive socket events.
579 Use this function to interrupt any wait operation currently in progress.
580 Note that this is not intended as a regular way to interrupt a Wait call,
581 but only as an escape mechanism for exceptional situations where it is
582 absolutely necessary to use it, for example to abort an operation due to
583 some exception or abnormal problem. InterruptWait is automatically called
584 when you Close() a socket (and thus also upon
585 socket destruction), so you don't need to use it in these cases.
588 wxSocketServer::WaitForAccept,
592 wxSocketClient::WaitOnConnect
594 void InterruptWait();
597 Returns @true if the socket is connected.
602 This function waits until the socket is readable. This might mean that
603 queued data is available for reading or, for streamed sockets, that
604 the connection has been closed, so that a read operation will complete
605 immediately without blocking (unless the @b wxSOCKET_WAITALL flag
606 is set, in which case the operation might still block).
611 Returns @true if the socket is not connected.
613 bool IsDisconnected();
616 Returns @true if the socket is initialized and ready and @false in other
619 #define bool IsOk() /* implementation is private */
622 Returns the number of bytes read or written by the last IO call.
624 Use this function to get the number of bytes actually transferred
625 after using one of the following IO calls: Discard, Peek, Read,
626 ReadMsg, Unread, Write, WriteMsg.
628 wxUint32
LastCount();
631 Returns the last wxSocket error. See @ref overview_wxsocketbase "wxSocket
634 Please note that this function merely returns the last error code,
635 but it should not be used to determine if an error has occurred (this
636 is because successful operations do not change the LastError value).
637 Use Error() first, in order to determine
638 if the last IO call failed. If this returns @true, use LastError
639 to discover the cause of the error.
641 wxSocketError
LastError();
644 According to the @e notify value, this function enables
645 or disables socket events. If @e notify is @true, the events
646 configured with SetNotify() will
647 be sent to the application. If @e notify is @false; no events
650 void Notify(bool notify
);
653 This function peeks a buffer of @e nbytes bytes from the socket.
654 Peeking a buffer doesn't delete it from the socket input queue.
656 Use LastCount() to verify the number of bytes actually peeked.
658 Use Error() to determine if the operation succeeded.
661 Buffer where to put peeked data.
666 @returns Returns a reference to the current object.
668 @sa Error(), LastError(), LastCount(),
671 wxSocketBase
Peek(void * buffer
, wxUint32 nbytes
);
674 This function reads a buffer of @e nbytes bytes from the socket.
676 Use LastCount() to verify the number of bytes actually read.
678 Use Error() to determine if the operation succeeded.
681 Buffer where to put read data.
686 @returns Returns a reference to the current object.
688 @sa Error(), LastError(), LastCount(),
691 wxSocketBase
Read(void * buffer
, wxUint32 nbytes
);
694 This function reads a buffer sent by WriteMsg()
695 on a socket. If the buffer passed to the function isn't big enough, the
696 remaining bytes will be discarded. This function always waits for the
697 buffer to be entirely filled, unless an error occurs.
699 Use LastCount() to verify the number of bytes actually read.
701 Use Error() to determine if the operation succeeded.
704 Buffer where to put read data.
709 @returns Returns a reference to the current object.
711 @sa Error(), LastError(), LastCount(),
712 SetFlags(), WriteMsg()
714 wxSocketBase
ReadMsg(void * buffer
, wxUint32 nbytes
);
717 This function restores the previous state of the socket, as saved
720 Calls to SaveState and RestoreState can be nested.
727 This function saves the current state of the socket in a stack. Socket
728 state includes flags, as set with SetFlags(),
729 event mask, as set with SetNotify() and
730 Notify(), user data, as set with
733 Calls to SaveState and RestoreState can be nested.
740 Sets user-supplied client data for this socket. All socket events will
741 contain a pointer to this data, which can be retrieved with
742 the wxSocketEvent::GetClientData function.
744 void SetClientData(void * data
);
747 Sets an event handler to be called when a socket event occurs. The
748 handler will be called for those events for which notification is
749 enabled with SetNotify() and
753 Specifies the event handler you want to use.
756 The id of socket event.
758 @sa SetNotify(), Notify(), wxSocketEvent, wxEvtHandler
760 void SetEventHandler(wxEvtHandler
& handler
, int id
= -1);
763 Use SetFlags to customize IO operation for this socket.
764 The @e flags parameter may be a combination of flags ORed together.
765 The following flags can be used:
771 Normal functionality.
776 Read/write as much data as possible and return immediately.
781 Wait for all required data to be read/written unless an error occurs.
786 Block the GUI (do not yield) while reading/writing data.
788 @b wxSOCKET_REUSEADDR
791 Allows the use of an in-use port (wxServerSocket only)
793 @b wxSOCKET_BROADCAST
796 Switches the socket to broadcast mode
801 Stops the socket from being bound to a specific adapter (normally used in
802 conjunction with @b wxSOCKET_BROADCAST)
804 A brief overview on how to use these flags follows.
806 If no flag is specified (this is the same as @b wxSOCKET_NONE),
807 IO calls will return after some data has been read or written, even
808 when the transfer might not be complete. This is the same as issuing
809 exactly one blocking low-level call to recv() or send(). Note
810 that @e blocking here refers to when the function returns, not
811 to whether the GUI blocks during this time.
813 If @b wxSOCKET_NOWAIT is specified, IO calls will return immediately.
814 Read operations will retrieve only available data. Write operations will
815 write as much data as possible, depending on how much space is available
816 in the output buffer. This is the same as issuing exactly one nonblocking
817 low-level call to recv() or send(). Note that @e nonblocking here
818 refers to when the function returns, not to whether the GUI blocks during
821 If @b wxSOCKET_WAITALL is specified, IO calls won't return until ALL
822 the data has been read or written (or until an error occurs), blocking if
823 necessary, and issuing several low level calls if necessary. This is the
824 same as having a loop which makes as many blocking low-level calls to
825 recv() or send() as needed so as to transfer all the data. Note
826 that @e blocking here refers to when the function returns, not
827 to whether the GUI blocks during this time.
829 The @b wxSOCKET_BLOCK flag controls whether the GUI blocks during
830 IO operations. If this flag is specified, the socket will not yield
831 during IO calls, so the GUI will remain blocked until the operation
832 completes. If it is not used, then the application must take extra
833 care to avoid unwanted reentrance.
835 The @b wxSOCKET_REUSEADDR flag controls the use of the SO_REUSEADDR standard
836 setsockopt() flag. This flag allows the socket to bind to a port that is
838 This is mostly used on UNIX-based systems to allow rapid starting and stopping
840 otherwise you may have to wait several minutes for the port to become available.
841 wxSOCKET_REUSEADDR can also be used with socket clients to (re)bind to a
842 particular local port
843 for an outgoing connection.
844 This option can have surprising platform dependent behavior, so check the
846 your platform's implementation of setsockopt(). Note that on BSD-based systems
848 use of wxSOCKET_REUSEADDR implies SO_REUSEPORT in addition to SO_REUSEADDR to
852 The @b wxSOCKET_BROADCAST flag controls the use of the SO_BROADCAST standard
853 setsockopt() flag. This flag allows the socket to use the broadcast address,
855 used in conjunction with @b wxSOCKET_NOBIND and wxIPaddress::BroadcastAddress.
859 @b wxSOCKET_NONE will try to read at least SOME data, no matter how much.
861 @b wxSOCKET_NOWAIT will always return immediately, even if it cannot
862 read or write ANY data.
864 @b wxSOCKET_WAITALL will only return when it has read or written ALL
867 @b wxSOCKET_BLOCK has nothing to do with the previous flags and
868 it controls whether the GUI blocks.
870 @b wxSOCKET_REUSEADDR controls special platform-specific behavior for
871 reusing local addresses/ports.
873 void SetFlags(wxSocketFlags flags
);
876 This function allows you to set the local address and port,
877 useful when an application needs to reuse a particular port. When
878 a local port is set for a wxSocketClient,
879 @b bind will be called before @b connect.
881 bool SetLocal(wxIPV4address
& local
);
884 SetNotify specifies which socket events are to be sent to the event handler.
885 The @e flags parameter may be combination of flags ORed together. The
886 following flags can be used:
889 @b wxSOCKET_INPUT_FLAG
892 to receive wxSOCKET_INPUT
894 @b wxSOCKET_OUTPUT_FLAG
897 to receive wxSOCKET_OUTPUT
899 @b wxSOCKET_CONNECTION_FLAG
902 to receive wxSOCKET_CONNECTION
904 @b wxSOCKET_LOST_FLAG
907 to receive wxSOCKET_LOST
910 In this example, the user will be notified about incoming socket data and
911 whenever the connection is closed.
913 For more information on socket events see @ref overview_wxsocketbase "wxSocket
916 void SetNotify(wxSocketEventFlags flags
);
919 This function sets the default socket timeout in seconds. This timeout
920 applies to all IO calls, and also to the Wait() family
921 of functions if you don't specify a wait interval. Initially, the default
922 timeout is 10 minutes.
924 void SetTimeout(int seconds
);
927 Functions to retrieve current state and miscellaneous info.
953 This function unreads a buffer. That is, the data in the buffer is put back
954 in the incoming queue. This function is not affected by wxSocket flags.
956 If you use LastCount(), it will always return @e nbytes.
958 If you use Error(), it will always return @false.
966 @returns Returns a reference to the current object.
968 @sa Error(), LastCount(), LastError()
970 wxSocketBase
Unread(const void * buffer
, wxUint32 nbytes
);
973 This function waits until any of the following conditions is @true:
976 The socket becomes readable.
977 The socket becomes writable.
978 An ongoing connection request has completed (wxSocketClient only)
979 An incoming connection request has arrived (wxSocketServer only)
980 The connection has been closed.
982 Note that it is recommended to use the individual Wait functions
983 to wait for the required condition, instead of this one.
986 Number of seconds to wait.
987 If -1, it will wait for the default timeout,
988 as set with SetTimeout.
991 Number of milliseconds to wait.
993 @returns Returns @true when any of the above conditions is satisfied,
994 @false if the timeout was reached.
996 @sa InterruptWait(), wxSocketServer::WaitForAccept,
997 WaitForLost(), WaitForRead(),
998 WaitForWrite(), wxSocketClient::WaitOnConnect
1000 bool Wait(long seconds
= -1, long millisecond
= 0);
1003 This function waits until the connection is lost. This may happen if
1004 the peer gracefully closes the connection or if the connection breaks.
1007 Number of seconds to wait.
1008 If -1, it will wait for the default timeout,
1009 as set with SetTimeout.
1012 Number of milliseconds to wait.
1014 @returns Returns @true if the connection was lost, @false if the timeout
1017 @sa InterruptWait(), Wait()
1019 bool Wait(long seconds
= -1, long millisecond
= 0);
1022 This function waits until the socket is readable. This might mean that
1023 queued data is available for reading or, for streamed sockets, that
1024 the connection has been closed, so that a read operation will complete
1025 immediately without blocking (unless the @b wxSOCKET_WAITALL flag
1026 is set, in which case the operation might still block).
1029 Number of seconds to wait.
1030 If -1, it will wait for the default timeout,
1031 as set with SetTimeout.
1034 Number of milliseconds to wait.
1036 @returns Returns @true if the socket becomes readable, @false on timeout.
1038 @sa InterruptWait(), Wait()
1040 bool WaitForRead(long seconds
= -1, long millisecond
= 0);
1043 This function waits until the socket becomes writable. This might mean that
1044 the socket is ready to send new data, or for streamed sockets, that the
1045 connection has been closed, so that a write operation is guaranteed to
1046 complete immediately (unless the @b wxSOCKET_WAITALL flag is set,
1047 in which case the operation might still block).
1050 Number of seconds to wait.
1051 If -1, it will wait for the default timeout,
1052 as set with SetTimeout.
1055 Number of milliseconds to wait.
1057 @returns Returns @true if the socket becomes writable, @false on timeout.
1059 @sa InterruptWait(), Wait()
1061 bool WaitForWrite(long seconds
= -1, long millisecond
= 0);
1064 This function writes a buffer of @e nbytes bytes to the socket.
1066 Use LastCount() to verify the number of bytes actually written.
1068 Use Error() to determine if the operation succeeded.
1071 Buffer with the data to be sent.
1076 @returns Returns a reference to the current object.
1078 @sa Error(), LastError(), LastCount(),
1081 wxSocketBase
Write(const void * buffer
, wxUint32 nbytes
);
1084 This function writes a buffer of @e nbytes bytes from the socket, but it
1085 writes a short header before so that ReadMsg()
1086 knows how much data should it actually read. So, a buffer sent with WriteMsg
1087 @b must be read with ReadMsg. This function always waits for the entire
1088 buffer to be sent, unless an error occurs.
1090 Use LastCount() to verify the number of bytes actually written.
1092 Use Error() to determine if the operation succeeded.
1095 Buffer with the data to be sent.
1098 Number of bytes to send.
1100 @returns Returns a reference to the current object.
1102 wxSocketBase
WriteMsg(const void * buffer
, wxUint32 nbytes
);
1107 @class wxDatagramSocket
1115 wxSocketBase::Error, wxSocketBase::LastError, wxSocketBase::LastCount,
1116 wxSocketBase::SetFlags,
1118 class wxDatagramSocket
: public wxSocketBase
1125 Socket flags (See wxSocketBase::SetFlags)
1127 wxDatagramSocket(wxSocketFlags flags
= wxSOCKET_NONE
);
1130 Destructor. Please see wxSocketBase::Destroy.
1132 ~wxDatagramSocket();
1135 This function reads a buffer of @e nbytes bytes from the socket.
1137 Use wxSocketBase::LastCount to verify the number of bytes actually read.
1139 Use wxSocketBase::Error to determine if the operation succeeded.
1142 Any address - will be overwritten with the address of the peer that sent that
1146 Buffer where to put read data.
1151 @returns Returns a reference to the current object, and the address of
1152 the peer that sent the data on address param.
1154 @sa wxSocketBase::Error, wxSocketBase::LastError, wxSocketBase::LastCount,
1155 wxSocketBase::SetFlags,
1157 wxDatagramSocket
ReceiveFrom(wxSockAddress
& address
,
1162 This function writes a buffer of @e nbytes bytes to the socket.
1164 Use wxSocketBase::LastCount to verify the number of bytes actually wrote.
1166 Use wxSocketBase::Error to determine if the operation succeeded.
1169 The address of the destination peer for this data.
1172 Buffer where read data is.
1177 @returns Returns a reference to the current object.
1179 wxDatagramSocket
SendTo(const wxSockAddress
& address
,
1180 const void * buffer
,