Package | com.lightstreamer.as_client.events |
Class | public class StatusChangeEvent |
Inheritance | StatusChangeEvent LSClientEvent flash.events.Event |
Dispatched whenever the connection status changes. A status change may be originated either by a custom action (e.g. by calling "openConnection") or by an internal action.
The normal cases are the following:
By setting a custom handler it is possible to perform actions related to connection and disconnection occurrences. Such actions can be issued directly inside a handler (e.g. to prevent an automatic reconnection attempt).
See also
Property | Defined By | ||
---|---|---|---|
client : LSClient [read-only]
The LSClient which this event is related to. | LSClientEvent | ||
previousStatus : String [read-only]
The previous status of the connection. | StatusChangeEvent | ||
sessionId : String [read-only]
The id of the current session. | StatusChangeEvent | ||
sessionServerAddress : String [read-only]
The hostname to be used to issue all requests related to the current
session. | StatusChangeEvent | ||
sessionServerName : String [read-only]
The instance name of the Server which is serving the current session. | StatusChangeEvent | ||
status : String [read-only]
The actual status of the connection. | StatusChangeEvent |
Constant | Defined By | ||
---|---|---|---|
STATUS_CHANGE : String = statusChange [static]
Define the value of the type property of a StatusChange event object. | StatusChangeEvent |
previousStatus | property |
previousStatus:String
[read-only] The previous status of the connection.
public function get previousStatus():String
sessionId | property |
sessionId:String
[read-only] The id of the current session. This property has a valid value only if the status value is STREAMING, POLLING or STALLED, otherwise it is null.
public function get sessionId():String
sessionServerAddress | property |
sessionServerAddress:String
[read-only]
The hostname to be used to issue all requests related to the current session. In fact, when a Server cluster is in place, the Server hostname specified through the Connection instance can identify various Server instances; in order to ensure that all requests related to a session are issued to the same Server instance, the Server can answer to the session opening request by providing a hostname which uniquely identifies its own instance. When this is the case, this property is valued as such hostname; otherwise, null is returned.
This property has a valid value only if the status value is STREAMING, POLLING or STALLED, otherwise it is null.
public function get sessionServerAddress():String
sessionServerName | property |
sessionServerName:String
[read-only]
The instance name of the Server which is serving the current session. To be more precise, each answering port configured on a Server instance (through a <http_server> or <https_server> element in the Server configuration file) can be given a different name; the name related to the port to which the session opening request has been issued is returned.
Note that in case of polling or in case rebind requests are needed, subsequent requests related to the same session may be issued to a port different than the one used for the first request; the names configured for those ports would not be reported. This, however, can only happen when a Server cluster is in place and particular configurations for the load balancer are used.
This property has a valid value only if the status value is STREAMING, POLLING or STALLED, otherwise it is null.
public function get sessionServerName():String
status | property |
status:String
[read-only] The actual status of the connection.
public function get status():String
STATUS_CHANGE | Constant |
public static const STATUS_CHANGE:String = statusChange
Define the value of the type property of a StatusChange event object.