| Added Methods |
void bind(SocketAddress)
|
Binds this DatagramSocket to a specific address & port. |
void connect(SocketAddress)
|
Connects this socket to a remote socket address (IP address + port number). |
boolean getBroadcast()
|
Tests if SO_BROADCAST is enabled. |
DatagramChannel getChannel()
|
Returns the unique java.nio.channels.DatagramChannel object associated with this datagram socket if any. |
SocketAddress getLocalSocketAddress()
|
Returns the address of the endpoint this socket is bound to or null if it is not bound yet. |
SocketAddress getRemoteSocketAddress()
|
Returns the address of the endpoint this socket is connected to or null if it is unconnected. |
boolean getReuseAddress()
|
Tests if SO_REUSEADDR is enabled. |
int getTrafficClass()
|
Gets traffic class or type-of-service in the IP datagram header for packets sent from this DatagramSocket. |
boolean isBound()
|
Returns the binding state of the socket. |
boolean isClosed()
|
Returns wether the socket is closed or not. |
boolean isConnected()
|
Returns the connection state of the socket. |
void setBroadcast(boolean)
|
Enable/disable SO_BROADCAST. |
void setReuseAddress(boolean)
|
Enable/disable the SO_REUSEADDR socket option. |
void setTrafficClass(int)
|
Sets traffic class or type-of-service octet in the IP datagram header for datagrams sent from this DatagramSocket. |