public class ConnectionPolicy
extends java.lang.Object
Constructor and Description |
---|
ConnectionPolicy()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getIdleTimeout()
Recalls the configured maximum time the Server is allowed to wait
for any data to be sent in response to a polling request,
if none has accumulated at request time.
|
int |
getKeepAliveInterval()
Recalls the configured interval between two keepalive packets to be
sent by Lightstreamer Server on a stream connection
when no actual data is being transmitted.
|
int |
getPollingInterval()
Recalls the configured polling interval to be used for poll connections.
|
int |
getRetryTimeout()
Recalls the configured time the library has to wait, after an
unsuccessful streaming or polling connection attempt, before
automatically performing a new attempt.
|
int |
getTimeoutForReconnect()
Recalls the configured time the client Engine, after entering
"STALLED" status, is allowed to wait for a keepalive packet or any data
on a stream connection, before disconnecting and trying to reconnect to the Server.
|
int |
getTimeoutForStalled()
Recalls the configured extra time the client Engine is allowed
to wait when an expected keepalive packet has not been received on a stream
connection (and no actual data has arrived), before entering the "STALLED" status.
|
boolean |
isBufferedStreamingHandled()
Recalls whether or not to enable the recovery mechanism for streaming
connections that appear to be buffered.
|
void |
setBufferedStreamingHandled(boolean bufferedStreamingHandled)
Setter method that turns on or off the recovery mechanism for streaming
connections that appear to be buffered.
|
void |
setIdleTimeout(int idleTimeout)
Setter method that sets the maximum time the Server is allowed to wait
for any data to be sent in response to a polling request, if none has accumulated at request time.
|
void |
setKeepAliveInterval(int keepAliveInterval)
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.
|
void |
setPollingInterval(int pollingInterval)
Setter method that sets the polling interval used for poll connections.
|
void |
setRetryTimeout(int retryTimeout)
Setter method that sets the time the library has to wait, after an
unsuccessful streaming or polling connection attempt, before
automatically performing a new attempt.
|
void |
setTimeoutForReconnect(int timeoutForReconnect)
Setter method that sets the time the client Engine, after entering
"STALLED" status, is allowed to wait for a keepalive packet or any data
on a stream connection, before disconnecting and trying to reconnect to the Server.
|
void |
setTimeoutForStalled(int timeoutForStalled)
Setter method that sets the extra time the client Engine is allowed
to wait when an expected keepalive packet has not been received on a stream
connection (and no actual data has arrived), before entering the "STALLED" status.
|
public int getIdleTimeout()
setIdleTimeout(int)
public void setIdleTimeout(int idleTimeout)
idleTimeout
- The time (in milliseconds) the Server is allowed
to wait for data to send upon polling requests (default is 19000).setPollingInterval(int)
public int getKeepAliveInterval()
setKeepAliveInterval(int)
public void setKeepAliveInterval(int keepAliveInterval)
keepAliveInterval
- The time, expressed in milliseconds, between two keepalive packets.
If no value is supplied, the Server will send keepalive packets based on its own configuration.setTimeoutForStalled(int)
,
setTimeoutForReconnect(int)
public int getPollingInterval()
setPollingInterval(int)
public void setPollingInterval(int pollingInterval)
pollingInterval
- The time (in milliseconds) between subsequent polling requests.
Zero is a legal value too, meaning that the client Engine will issue
a new polling request as soon as a previous one has returned (default is 0).setIdleTimeout(int)
,
LSClient.openPollingConnection(ConnectionInfo, ConnectionListener)
,
LSClient.openPollingConnection(ConnectionInfo, ConnectionListener, ConnectionPolicy)
public int getTimeoutForReconnect()
public void setTimeoutForReconnect(int timeoutForReconnect)
timeoutForReconnect
- The idle time (in milliseconds) allowed
in "STALLED" status before trying to reconnect to the Server (default is 3000).setKeepAliveInterval(int)
,
LSClient.getStatus()
,
ConnectionListener.onStatusChange(String)
public int getTimeoutForStalled()
public void setTimeoutForStalled(int timeoutForStalled)
timeoutForStalled
- The idle time (in milliseconds) allowed before
entering the "STALLED" status (default is 2000).setKeepAliveInterval(int)
,
LSClient.getStatus()
,
ConnectionListener.onStatusChange(String)
public int getRetryTimeout()
public void setRetryTimeout(int retryTimeout)
retryTimeout
- The time (in milliseconds) to wait (default is 5000).public boolean isBufferedStreamingHandled()
public void setBufferedStreamingHandled(boolean bufferedStreamingHandled)
bufferedStreamingHandled
- true or false, to enable or disable
the recovery mechanism for streaming connections that appear to be buffered.
(Default value is false)LSClient.useSingleConnection(boolean)