class AMFChannel
package feathers.messaging.channels
extends NetConnectionChannel › PollingChannel › Channel
extended by SecureAMFChannel
The AMFChannel class provides the AMF support for messaging. You can configure this Channel to poll the server at an interval to approximate server push. You can also use this Channel with polling disabled to send RPC messages to remote destinations to invoke their methods.
The AMFChannel relies on network services native to Flash Player and AIR, and exposed to ActionScript by the NetConnection class. This channel uses NetConnection exclusively, and creates a new NetConnection per instance.
Channels are created within the framework using the
ServerConfig.getChannel()
method. Channels can be constructed
directly and assigned to a ChannelSet if desired.
Channels represent a physical connection to a remote endpoint. Channels are shared across destinations by default. This means that a client targetting different destinations may use the same Channel to communicate with these destinations.
When used in polling mode, this Channel polls the server for new messages
based on the polling-interval-seconds
property in the configuration file,
and this can be changed by setting the pollingInterval
property.
The default value is 3 seconds.
To enable polling, the channel must be connected and the polling-enabled
property in the configuration file must be set to true
, or the
pollingEnabled
property of the Channel must be set to true
.
Constructor
new(?id:String, ?uri:String)
Constructor.
Parameters:
id | The id of this Channel. |
---|---|
uri | The uri for this Channel. |
Variables
piggybackingEnabled:Bool
Indicates whether this channel will piggyback poll requests along with regular outbound messages when an outstanding poll is not in progress. This allows the server to piggyback data for the client along with its response to client's message.
pollingInterval:Float
Provides access to the polling interval for this Channel. The value is in milliseconds. This value determines how often this Channel requests messages from the server, to approximate server push.
Throws:
ArgumentError | If the pollingInterval is assigned a value of 0 or less. |
---|
Methods
AppendToGatewayUrl(value:String):Void
Overriding to be able to keep track of the fact that the Channel is in the process of reconnecting with the session id, so the initial NetConnection call can be discarded properly in the resultHandler.