Share this page

# LrJposChannel.setSoLinger

Defines how the close function operates for a socket.

`public static void setSoLinger(boolean on, int linger)`

## Parameters

Parameter | Description
--- | ---
on | Boolean value that represents the status of the SoLinger option.
linger | Integer 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");
            }
    }

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