setKeepaliveInterval method

void setKeepaliveInterval(
  1. int newVal
)

Setter method that sets the interval between two keepalive packets to be sent by Lightstreamer Server on a stream connection when no actual data is being transmitted.

The Server may, however, impose a lower limit on the keepalive interval, in order to protect itself. Also, the Server may impose an upper limit on the keepalive interval, in order to be able to check for client-side connection drops. If 0 is specified, the interval will be decided by the Server.

Default 0 (meaning that the Server will send keepalive packets based on its own configuration).

Lifecycle The keepalive interval should be set before calling the LightstreamerClient.connect method. However, the value can be changed at any time: the supplied value will be used for the next streaming connection (either a bind or a brand new session).
Note that, after a connection, the value may be changed to the one imposed by the Server.

Notification A change to this setting will be notified through a call to ClientListener.onPropertyChange with argument "keepaliveInterval" on any ClientListener listening to the related LightstreamerClient.

  • newVal the keepalive interval time (in milliseconds) to set, or 0.

Throws IllegalArgumentException if a negative value is configured

Implementation

external void setKeepaliveInterval(int newVal);