Package com.oroinc.net
Class DefaultDatagramSocketFactory
- java.lang.Object
-
- com.oroinc.net.DefaultDatagramSocketFactory
-
- All Implemented Interfaces:
DatagramSocketFactory
public class DefaultDatagramSocketFactory extends java.lang.Object implements DatagramSocketFactory
DefaultDatagramSocketFactory implements the DatagramSocketFactory interface by simply wrapping the java.net.DatagramSocket constructors. It is the default DatagramSocketFactory used by DatagramSocketClient implementations.- Author:
- Daniel F. Savarese
- See Also:
DatagramSocketFactory
,DatagramSocketClient
,DatagramSocketClient.setDatagramSocketFactory(com.oroinc.net.DatagramSocketFactory)
-
-
Constructor Summary
Constructors Constructor Description DefaultDatagramSocketFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods 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.
-
-
-
Method Detail
-
createDatagramSocket
public java.net.DatagramSocket createDatagramSocket() throws java.net.SocketException
Creates a DatagramSocket on the local host at the first available port.- Specified by:
createDatagramSocket
in interfaceDatagramSocketFactory
- Throws:
java.net.SocketException
- If the socket could not be created.
-
createDatagramSocket
public java.net.DatagramSocket createDatagramSocket(int port) throws java.net.SocketException
Creates a DatagramSocket on the local host at a specified port.- Specified by:
createDatagramSocket
in interfaceDatagramSocketFactory
- Parameters:
port
- The port to use for the socket.- Throws:
java.net.SocketException
- If the socket could not be created.
-
createDatagramSocket
public java.net.DatagramSocket createDatagramSocket(int port, java.net.InetAddress laddr) throws java.net.SocketException
Creates a DatagramSocket at the specified address on the local host at a specified port.- Specified by:
createDatagramSocket
in interfaceDatagramSocketFactory
- Parameters:
port
- The port to use for the socket.laddr
- The local address to use.- Throws:
java.net.SocketException
- If the socket could not be created.
-
-