Package org.apache.commons.net
Class DefaultDatagramSocketFactory
java.lang.Object
org.apache.commons.net.DefaultDatagramSocketFactory
- All Implemented Interfaces:
- DatagramSocketFactory
Implements the DatagramSocketFactory interface by simply wrapping the 
DatagramSocket constructors. It is the default DatagramSocketFactory used by
 DatagramSocketClient implementations.- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionCreates a DatagramSocket on the local host at the first available port.createDatagramSocket(int port) Creates a DatagramSocket on the local host at a specified port.createDatagramSocket(int port, InetAddress localAddress) Creates a DatagramSocket at the specified address on the local host at a specified port.
- 
Constructor Details- 
DefaultDatagramSocketFactorypublic DefaultDatagramSocketFactory()
 
- 
- 
Method Details- 
createDatagramSocketCreates a DatagramSocket on the local host at the first available port.- Specified by:
- createDatagramSocketin interface- DatagramSocketFactory
- Returns:
- a new DatagramSocket
- Throws:
- SocketException- If the socket could not be created.
 
- 
createDatagramSocketCreates a DatagramSocket on the local host at a specified port.- Specified by:
- createDatagramSocketin interface- DatagramSocketFactory
- Parameters:
- port- The port to use for the socket.
- Returns:
- a new DatagramSocket
- Throws:
- SocketException- If the socket could not be created.
 
- 
createDatagramSocketpublic DatagramSocket createDatagramSocket(int port, InetAddress localAddress) throws SocketException Creates a DatagramSocket at the specified address on the local host at a specified port.- Specified by:
- createDatagramSocketin interface- DatagramSocketFactory
- Parameters:
- port- The port to use for the socket.
- localAddress- The local address to use.
- Returns:
- a new DatagramSocket
- Throws:
- SocketException- If the socket could not be created.
 
 
-