LrJposChannel.getSocketFactory

Gets the socket factory that was set for the channel.

public static ISOClientSocketFactory getSocketFactory()

Return values

This function returns the value for the org.jpos.iso.ISOClientSocketFactory instance, or null if none is set.

General information

The socket factory is used by the channel to create special sockets. It might also be used to provide hooks for SSL implementations.

Example

Copy code
public void socketFactoryTest() throws Throwable{

        GenericPackager packager = new GenericPackager(PACKAGERCONFIGFILE);
        LrJposChannel.initChannel(LrJposChannel.ChannelType.GZIPChannel, "localhost", 8000, packager);
        
        ISOClientSocketFactory socketFactory = new GenericSSLSocketFactory();
        LrJposChannel.setSocketFactory(socketFactory);
        
        ISOClientSocketFactory result = LrJposChannel.getSocketFactory();
        if (result == socketFactory) {
            lr.output_message("same instances");
        }
        else {
            lr.output_message("different instances");
        }
        
        LrJposChannel.closeChannel();
}