⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.net

Class DefaultDatagramSocketFactory

java.lang.Object
|
+--org.apache.commons.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

Method Summary

DatagramSocket

createDatagramSocket()

Creates a DatagramSocket on the local host at the first available port.

DatagramSocket

createDatagramSocket(int port)

Creates a DatagramSocket on the local host at a specified port.

DatagramSocket

createDatagramSocket(int port, InetAddress laddr)

Creates a DatagramSocket at the specified address on the local host at a specified port.

Method Details

createDatagramSocket

public DatagramSocket createDatagramSocket()

Creates a DatagramSocket on the local host at the first available port.

Throws:
- 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:
- 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:
- If the socket could not be created.