LrJposChannel.setSoLinger

Defines how the close function operates for a socket.

public static void setSoLinger(boolean on, int linger)

Parameters

ParameterDescription
onBoolean value that represents the status of the SoLinger option.
lingerInteger value that represents the linger timeout, in seconds.

Return values

This function does not return any values.

General information

The SoLinger function sets the delay (linger time) that the socket Gateway waits before closing a socket, after a call is received to close the socket, but data is still being transmitted.

 

Example

Copy code
public void soLinger() {
        
        if (LrJposChannel.isSoLingerOn()) {
            int sec = LrJposChannel.getSoLingerSeconds();
            lr.output_message("SoLinger option is ON and set for " + sec + " seconds");
        }
        else {
            LrJposChannel.setSoLinger(true, 3);
            lr.output_message("SoLinger option is OFF");
        }
}