Share this page

# LrJposChannel.isExpectKeepAlive

Checks if a keep-alive message is expected.

`public static boolean isExpectKeepAlive()`

## Return values

This function returns true if a keep-alive message is expected, otherwise returns false.

## Example

Copy code

    public int init() throws Throwable {

            AsciiPackager2003 pack = new AsciiPackager2003();
            LrJposChannel.initChannel(LrJposChannel.ChannelType.ASCIIChannel);
            LrJposChannel.setHost("your server's host name");
            LrJposChannel.setPort(8000);
            LrJposChannel.setPackager(pack);
            LrJposChannel.connect();

            if (LrJposChannel.isExpectKeepAlive()) {
                LrJposChannel.sendKeepAlive();
            }

            return 0;
    }

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: