1 constructors
Create a disconnected IPv4 datagram Socket:
Datagramsocket ();
Creates a datagram Socket that specifies the IP type (IPV4 or IPV6):
Explicit Datagramsocket (ipaddress::family Family);
Create a datagram Socket with a specified socketaddress
Datagramsocket (const socketaddress& address, bool
reuseaddress = false);
Datagramsocket (const socket& Socket);
Creates the Datagramsocket with the SocketImpl
///from another socket. The SocketImpl must
is///a datagramsocketimpl, otherwise an invalidargumentexception
///would be thrown.
2 Overloaded operators
datagramsocket& operator = (const socket& Socket);
Assignment operator.
///releases the socket ' s SocketImpl and///attaches the SocketImpl from the other
socket and
/// Ements the reference count of the SocketImpl.
3 Common operations
3.1 Connections and bindings
void Connect (const socketaddress& address);
void bind (const socketaddress& address, BOOL reuseaddress = false);
3.2 Send and receive data without regard to client
int sendbytes (const void* buffer, int length, int flags = 0);
int receivebytes (void* buffer, int length, int flags = 0);
3.3 Manipulation data and obtaining client's socketaddress
int SendTo (const void* buffer, int length, const socketaddress& address, int flags = 0);
int ReceiveFrom (void* buffer, int length, socketaddress& address, int flags = 0);
3.4 Radio and transceiver
void Setbroadcast (bool flag);
BOOL Getbroadcast () const;
4 protected function
Datagramsocket (socketimpl* Pimpl);
Reprinted please the famous CSDN blog from Liuda: blog.csdn.net/poechant
View a full set of articles: Http://www.bianceng.cn/Programming/cplus/201301/35022.htm