Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
javax.net

Class SocketFactory

java.lang.Object
|
+--javax.net.SocketFactory


public abstract class SocketFactory

extends java.lang.Object

A factory for client sockets. The purpose of this class is to serve as the superclass of server socket factories that produce client sockets of a particular type, such as Secure Socket Layer (SSL) sockets.

Author:

Constructor Summary

SocketFactory()

Default 0-arguments constructor.

Method Summary

SocketcreateSocket()

Returns an unbound client socket.
SocketcreateSocket(String host, int port)

Creates a socket connected to a given host on a given port.
SocketcreateSocket(String host, int port, InetAddress localHost, int localPort)

Creates a socket connected to a given host on a given port, connecting locally to the interface with the given address and port.
SocketcreateSocket(InetAddress host, int port)

Creates a socket connected to a given host on a given port.
SocketcreateSocket(InetAddress hast, int port, InetAddress localHost, int localPort)

Creates a socket connected to a given host on a given port, connecting locally to the interface with the given address and port.
static synchronized javax.net.SocketFactorygetDefault()

Returns the default socket factory.

Constructor Details

SocketFactory

protected SocketFactory()

Default 0-arguments constructor.


Method Details

createSocket

public Socket createSocket()

Returns an unbound client socket.

Returns:


createSocket

public Socket createSocket(InetAddress host, int port)

Creates a socket connected to a given host on a given port.

Parameters:

Returns:

Throws:


createSocket

public Socket createSocket(InetAddress hast, int port, InetAddress localHost, int localPort)

Creates a socket connected to a given host on a given port, connecting locally to the interface with the given address and port.

Parameters:

Returns:

Throws:


createSocket

public Socket createSocket(String host, int port)

Creates a socket connected to a given host on a given port.

Parameters:

Returns:

Throws:


createSocket

public Socket createSocket(String host, int port, InetAddress localHost, int localPort)

Creates a socket connected to a given host on a given port, connecting locally to the interface with the given address and port.

Parameters:

Returns:

Throws:


getDefault

public static synchronized SocketFactory getDefault()

Returns the default socket factory. The type of factory returned may depend upon the installation.

Returns: