DatagramSocket Members

DatagramSocket Members

Class Overview | This Package | All Packages

Constructors
Name Description
DatagramSocket() Constructs a datagram socket and binds it to any available port on the local host machine.
DatagramSocket(int) Constructs a datagram socket and binds it to the specified port on the local host machine.
DatagramSocket(int, InetAddress) Creates a datagram socket, bound to the specified local address.

Methods
Name Description
close() Closes this datagram socket.
getLocalAddress() Gets the local address to which the socket is bound.
getLocalPort() Returns the port number on the local host to which this socket is bound.
getSoTimeout() Retrive setting for SO_TIMEOUT.
receive(DatagramPacket) Receives a datagram packet from this socket.
send(DatagramPacket) Sends a datagram packet from this socket.
setSoTimeout(int) Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds.