Package org.globus.net

# Class SocketFactory

java.lang.Object
org.globus.net.SocketFactory

public class SocketFactory extends Object
This factory allows for creating regular sockets. If the tcp.source.port.range system property is set it will create sockets within the specified local port range (if the local port number is set to 0).

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`SocketFactory()`

## Method Summary

Modifier and Type
Method
Description
`Socket`
`createSocket(String host, int port)`
`Socket`
`createSocket(String host, int port, InetAddress localAddr, int localPort)`
`Socket`
`createSocket(InetAddress address, int port)`
`Socket`
`createSocket(InetAddress address, int port, InetAddress localAddr, int localPort)`
`static SocketFactory`
`getDefault()`
Returns the default instance of this class.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SocketFactory

protected SocketFactory()

## Method Details

### getDefault

public static SocketFactory getDefault()
Returns the default instance of this class.

Returns:
  SocketFactory instance of this class.

### createSocket

public Socket createSocket(String host, int port) throws IOException

Throws:
  `IOException`

### createSocket

public Socket createSocket(InetAddress address, int port) throws IOException

Throws:
  `IOException`

### createSocket

public Socket createSocket(String host, int port, InetAddress localAddr, int localPort) throws IOException

Throws:
  `IOException`

### createSocket

public Socket createSocket(InetAddress address, int port, InetAddress localAddr, int localPort) throws IOException

Throws:
  `IOException`