Share this page

# 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

Parameter | Description
--- | ---
channelType | Enum value that contains the type of the channel to use.
host | The host to connect to.
port | The port to connect to.
packager | ISOPackager instance to use for packing/unpacking messages.
serverSocket | ServerSocket 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;
        }

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