LrJposChannel.initChannel

Initializes the channel.

public static void initChannel(ChannelType channelType)

public static void initChannel(ChannelType channelType, String host, int port, ISOPackager packager)

public static void initChannel(ChannelType channelType, ISOPackager packager)

public static void initChannel(ChannelType channelType, ISOPackager packager, ServerSocket serverSocket)

Parameters

ParameterDescription
channelTypeEnum value that contains the type of the channel to use.
hostThe host to connect to.
port The port to connect to.
packagerISOPackager instance to use for packing/unpacking messages.
serverSocketServerSocket instance associated with the channel.

Return values

This function does not return any values.

General information

Channels are responsible for sending and receiving messages, so nothing can be sent or received before the channel is initialized. Each Vuser can only have one channel initialized at a time.

The Finance ISO protocol supports available jPOS channel types (except for LoopbackChannel). For a list of supported channels, see Finance ISO protocol.

Example

Copy code
public int init() throws Throwable {
        
        AsciiPackager2003 pack = new AsciiPackager2003();
        LrJposChannel.initChannel(LrJposChannel.ChannelType.ASCIIChannel, "localhost", 8000, pack);
        
        return 0;
    }