Packagecom.lightstreamer.as_client
Classpublic class ConnectionPolicy

ConnectionPolicy collects the timeouts used for the connections to Lightstreamer Server..



Public Methods
 MethodDefined by
  
Create an object that encapsulates the timeout settings, with default values.
ConnectionPolicy
  
setBufferedStreamingHandled(bufferedStreamingHandled:Boolean):void
Setter method that turns on or off the recovery mechanism for streaming connections that appear to be buffered.
ConnectionPolicy
  
setIdleTimeout(idleTimeout:uint):void
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 no data is available at request time.
ConnectionPolicy
  
setKeepaliveInterval(keepaliveInterval:uint):void
Setter method that sets the interval between two keepalive packets (heartbeats) sent by Lightstreamer Server on a stream connection when no actual data is being transmitted.
ConnectionPolicy
  
setPollingInterval(pollingInterval:uint):void
Setter method that sets the polling interval used for poll connections.
ConnectionPolicy
  
setRetryTimeout(retryTimeout:uint):void
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.
ConnectionPolicy
  
setTimeoutForReconnect(reconnectTimeout:uint):void
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.
ConnectionPolicy
  
setTimeoutForStalled(stalledTimeout:uint):void
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.
ConnectionPolicy
Constructor detail
ConnectionPolicy()constructor
public function ConnectionPolicy()

Create an object that encapsulates the timeout settings, with default values.

Method detail
setBufferedStreamingHandled()method
public function setBufferedStreamingHandled(bufferedStreamingHandled:Boolean):void

Setter method that turns on or off the recovery mechanism for streaming connections that appear to be buffered. When the network infrastructure buffers the initial part of the streaming data flow, the Client automatically switches to smart polling mode. Setting this property to true enables the Client to switch-back to streaming mode if the network infrastructure releases the data after the initial buffering. This recovery mechanism is one of the features of the "Stream-sense" mechanism. It allows a better quality communication channel to be finally established in many cases. But if some intermediate proxy or antivirus buffers the streaming data flow in blocks (that is, not only on the initial part), then the streaming recovery may lead to a worse communication channel, with pauses that may even cause the client Engine to enter the "STALLED" status.

Parameters
bufferedStreamingHandled:Boolean — true or false, to enable or disable the recovery mechanism for streaming connections that appear to be buffered. (Default value is false)
setIdleTimeout()method 
public function setIdleTimeout(idleTimeout:uint):void

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 no data is available at request time. Setting this time to a non-zero value and the polling interval to zero leads to an "asynchronous polling" behaviour, which, on low data rates, is very similar to the streaming mode. Setting this time to zero and the polling interval to a nonzero value, on the other hand, leads to a classical "synchronous polling". Note that the Server may, in some cases, delay the answer for more than the supplied time, to protect itself against a high polling rate or because of bandwidth restrictions. Also, the Server may impose an upper limit on the wait time, in order to be able to check for client-side connection drops.

Parameters
idleTimeout:uint — The time, expressed on milliseconds, the Server is allowed to wait for data to send upon polling requests (default is 30000).

Throws
ConfigurationError — An invalid number was specified.

See also

setKeepaliveInterval()method 
public function setKeepaliveInterval(keepaliveInterval:uint):void

Setter method that sets the interval between two keepalive packets (heartbeats) 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.

Parameters
keepaliveInterval:uint — 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.

Throws
ConfigurationError — An invalid number was specified.

See also

setPollingInterval()method 
public function setPollingInterval(pollingInterval:uint):void

Setter method that sets the polling interval used for poll connections. The client Engine switches from the default streaming mode to polling mode when the client network infrastructure does not allow streaming on HTTP connections. Also, polling mode can be forced by calling the openPollingConnection method of the LSClient class. The polling interval affects the rate at which polling requests are issued. It is the time between the start of a polling request and the start of the next request. However, if the polling interval expires before the first polling request has returned, then the second polling request is delayed. This may happen, for instance, when the Server delays the answer because of the idle timeout setting. In any case, the polling interval allows for setting an upper limit on the polling frequency. The Server does not impose a lower limit on the client polling interval. However, in some cases, it may protect itself against a high polling rate by delaying its answer. Network limitations and configured bandwidth limits may also lower the polling rate, despite of the client polling interval. The Server may, however, impose an upper limit on the polling interval, in order to be able to promptly detect terminated polling request sequences and discard related session information.

Parameters
pollingInterval:uint — The time, expressed on 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 500).

Throws
ConfigurationError — An invalid number was specified.

See also

setRetryTimeout()method 
public function setRetryTimeout(retryTimeout:uint):void

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.

Parameters
retryTimeout:uint — The wait time, expressed on milliseconds (default is 5000).

Throws
ConfigurationError — An invalid number was specified.
setTimeoutForReconnect()method 
public function setTimeoutForReconnect(reconnectTimeout:uint):void

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. (Default value is 15000)

Parameters
reconnectTimeout:uint

Throws
ConfigurationError — An invalid number was given.

See also

setTimeoutForStalled()method 
public function setTimeoutForStalled(stalledTimeout:uint):void

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. (Default value is 2000)

Parameters
stalledTimeout:uint

Throws
ConfigurationError — An invalid number was given.

See also