FileDocCategorySizeDatePackage
DefaultDatagramSocketFactory.javaAPI DocApache Commons NET 1.4.1 API2388Sat Dec 03 10:05:48 GMT 2005org.apache.commons.net

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
DatagramSocketFactory
see
DatagramSocketClient
see
DatagramSocketClient#setDatagramSocketFactory

Fields Summary
Constructors Summary
Methods Summary
public java.net.DatagramSocketcreateDatagramSocket()
Creates a DatagramSocket on the local host at the first available port.

exception
SocketException If the socket could not be created.

        return new DatagramSocket();
    
public java.net.DatagramSocketcreateDatagramSocket(int port)
Creates a DatagramSocket on the local host at a specified port.

param
port The port to use for the socket.
exception
SocketException If the socket could not be created.

        return new DatagramSocket(port);
    
public java.net.DatagramSocketcreateDatagramSocket(int port, java.net.InetAddress laddr)
Creates a DatagramSocket at the specified address on the local host at a specified port.

param
port The port to use for the socket.
param
laddr The local address to use.
exception
SocketException If the socket could not be created.

        return new DatagramSocket(port, laddr);