Package | com.aispeech.factory |
Class | public class ConnectionFactory |
Inheritance | ConnectionFactory ![]() |
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)Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
ConnectionFactory(authSignagure:Object, urlListServiceURL:String, connectLocalService:Boolean = false)
Constructor
| ConnectionFactory | ||
createConnection():void
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 | ||
sendURLListRequest():void | ConnectionFactory | ||
startConnecting():void | ConnectionFactory |
connectionHistory | property |
connectionHistory:Array
[read-only] public function get connectionHistory():Array
DEFAULT_API_SERVICE_URL_ARRAY | property |
public static var DEFAULT_API_SERVICE_URL_ARRAY:Array
LOCAL_SERVICE_URL | property |
public static var LOCAL_SERVICE_URL:String = http://127.0.0.1:5768
ConnectionFactory | () | Constructor |
public function ConnectionFactory(authSignagure:Object, urlListServiceURL:String, connectLocalService:Boolean = false)
Constructor
ParametersauthSignagure:Object — a list of RTMP service URL, default null
| |
urlListServiceURL:String | |
connectLocalService:Boolean (default = false )
|
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