DatagramSocketFactorypublic class DefaultDatagramSocketFactory extends java.lang.Object implements DatagramSocketFactory
DatagramSocketClient
implementations.
DatagramSocketFactory,
DatagramSocketClient,
DatagramSocketClient.setDatagramSocketFactory(org.apache.commons.net.DatagramSocketFactory)| Constructor | Description |
|---|---|
DefaultDatagramSocketFactory() |
| Modifier and Type | Method | Description |
|---|---|---|
java.net.DatagramSocket |
createDatagramSocket() |
Creates a DatagramSocket on the local host at the first available port.
|
java.net.DatagramSocket |
createDatagramSocket(int port) |
Creates a DatagramSocket on the local host at a specified port.
|
java.net.DatagramSocket |
createDatagramSocket(int port,
java.net.InetAddress laddr) |
Creates a DatagramSocket at the specified address on the local host
at a specified port.
|
public java.net.DatagramSocket createDatagramSocket()
throws java.net.SocketException
createDatagramSocket in interface DatagramSocketFactoryjava.net.SocketException - If the socket could not be created.public java.net.DatagramSocket createDatagramSocket(int port)
throws java.net.SocketException
createDatagramSocket in interface DatagramSocketFactoryport - The port to use for the socket.java.net.SocketException - If the socket could not be created.public java.net.DatagramSocket createDatagramSocket(int port,
java.net.InetAddress laddr)
throws java.net.SocketException
createDatagramSocket in interface DatagramSocketFactoryport - The port to use for the socket.laddr - The local address to use.java.net.SocketException - If the socket could not be created.