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 SAP jConnect extension interface that contains the createSocket(String, int, Properties) method, which returns a java.net.Socket. To use a custom socket factory in SAP jConnect, an application must implement this interface by defining the createSocket() method.
/** * 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).