Share this page

# LrJposChannel.setSocketFactory

Sets the socket factory to be used by the channel.

`public static void setSocketFactory(ISOClientSocketFactory socketFactory)`

## Parameters

- socketFactory: The org.jpos.iso.ISOClientSocketFactory instance that represents the socket factory to be set for the channel.

## Return values

This function does not return any values.

## 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();
    }

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: