Packagecom.aispeech.factory
Classpublic class ConnectionFactory
InheritanceConnectionFactory Inheritance flash.events.EventDispatcher

Connection factory

If not instructed, connection factory firstly try local service (timout in 2 seconds). If failed, it connect the URLList webservice to retrieve an array of connection candidates. If such effort fails, it uses the defalt connection candidates.

Given an array connection candidates, it firstly try rtmp service, and then rtmpt service if necessary. It uses GroupConnectionStraty instance to make connection to the candidates.

Dispatch FactoryEvent.READY event, if one connection established data {connection:IConnection}

Dispatch FactoryEvent.EXCEPTION_TIMEOUT, if no connection established

Connection factory also manage connection history and re-connecting stratety: number of continuous retry is limited and assuming local server never close (for the time being)



Public Properties
 PropertyDefined By
  connectionHistory : Array
[read-only]
ConnectionFactory
  DEFAULT_API_SERVICE_URL_ARRAY : Array
[static]
ConnectionFactory
  LOCAL_SERVICE_URL : String = http://127.0.0.1:5768
[static]
ConnectionFactory
Public Methods
 MethodDefined By
  
ConnectionFactory(authSignagure:Object, urlListServiceURL:String, connectLocalService:Boolean = false)
Constructor
ConnectionFactory
  
Create connection(s) check local host first then all rtmp then rtmpt if all fails check http connetions
ConnectionFactory
  
createConnectionParamsArray(urlListArray:Array, timeout:int, authSignagure:Object):void
ConnectionFactory
  
ConnectionFactory
  
ConnectionFactory
Property Detail
connectionHistoryproperty
connectionHistory:Array  [read-only]


Implementation
    public function get connectionHistory():Array
DEFAULT_API_SERVICE_URL_ARRAYproperty 
public static var DEFAULT_API_SERVICE_URL_ARRAY:Array

LOCAL_SERVICE_URLproperty 
public static var LOCAL_SERVICE_URL:String = http://127.0.0.1:5768

Constructor Detail
ConnectionFactory()Constructor
public function ConnectionFactory(authSignagure:Object, urlListServiceURL:String, connectLocalService:Boolean = false)

Constructor

Parameters
authSignagure:Object — a list of RTMP service URL, default null
 
urlListServiceURL:String
 
connectLocalService:Boolean (default = false)
Method Detail
createConnection()method
public function createConnection():void

Create connection(s) check local host first then all rtmp then rtmpt if all fails check http connetions

createConnectionParamsArray()method 
public function createConnectionParamsArray(urlListArray:Array, timeout:int, authSignagure:Object):void

Parameters

urlListArray:Array
 
timeout:int
 
authSignagure:Object

sendURLListRequest()method 
public function sendURLListRequest():void

startConnecting()method 
public function startConnecting():void