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;
}