Implement Custom SSL Socket Plug-ins

Plug a custom socket implementation into an application to customize the communication between a client and server.

javax.net.ssl.SSLSocket is an example of a socket that you can customize to enable encryption.

com.sybase.jdbcx.SybSocketFactory is a Sybase extension interface that contains the createSocket(String, int, Properties) method, which returns a java.net.Socket. To use a custom socket factory in jConnect, an application must implement this interface by defining the createSocket() method.

jConnect uses the socket for subsequent input or output operations. Classes that implement SybSocketFactory create sockets and provide a general framework for the addition of public socket-level functionality, as shown:
/**
 * Returns a socket connected to a ServerSocket on the named host,
 * at the given port.
 * @param host  the server host
 * @param port  the server port
 * @param props  Properties passed in through the connection
 * @returns Socket
 * @exception IOException, UnknownHostException
 */
public java.net.Socket createSocket(String host, int port, Properties props)
   throws IOException, UnknownHostException;

Passing in properties allows instances of SybSocketFactory to use connection properties to implement an intelligent socket.

When you implement SybSocketFactory, the same application code can use different kinds of sockets by passing the different kinds of factories or pseudo-factories that create sockets to the application.

You can customize factories with parameters used in socket construction. For example, you can customize factories to return sockets with different networking timeouts or security parameters already configured. The sockets returned to the application can be subclasses of java.net.Socket to directly expose new APIs for features such as compression, security, record marking, statistics collection, or firewall tunnelling (javax.net.SocketFactory).

Note: SybSocketFactory is intended to be an overly simplified javax.net.SocketFactory, enabling applications to bridge from java.net.* to javax.net.*