org.apache.commons.net

Class DefaultDatagramSocketFactory

public class DefaultDatagramSocketFactory extends Object implements DatagramSocketFactory

DefaultDatagramSocketFactory implements the DatagramSocketFactory interface by simply wrapping the java.net.DatagramSocket constructors. It is the default DatagramSocketFactory used by {@link org.apache.commons.net.DatagramSocketClient} implementations.

Author: Daniel F. Savarese

See Also: DatagramSocketFactory DatagramSocketClient DatagramSocketClient

Method Summary
DatagramSocketcreateDatagramSocket()
Creates a DatagramSocket on the local host at the first available port.
DatagramSocketcreateDatagramSocket(int port)
Creates a DatagramSocket on the local host at a specified port.
DatagramSocketcreateDatagramSocket(int port, InetAddress laddr)
Creates a DatagramSocket at the specified address on the local host at a specified port.

Method Detail

createDatagramSocket

public DatagramSocket createDatagramSocket()
Creates a DatagramSocket on the local host at the first available port.

Throws: SocketException If the socket could not be created.

createDatagramSocket

public DatagramSocket createDatagramSocket(int port)
Creates a DatagramSocket on the local host at a specified port.

Parameters: port The port to use for the socket.

Throws: SocketException If the socket could not be created.

createDatagramSocket

public DatagramSocket createDatagramSocket(int port, InetAddress laddr)
Creates a DatagramSocket at the specified address on the local host at a specified port.

Parameters: port The port to use for the socket. laddr The local address to use.

Throws: SocketException If the socket could not be created.