public final class Engine
extends java.lang.Object
通过 EngineOptions
初始化该类。
初始化过程中会创建 AutoReconnectConnection
,ChatManager
和 ChannelManager
的实例,有且只有一个。
支持单个应用中多个实例。
Constructor and Description |
---|
Engine(Context context,
EngineOptions options)
以 options 的配置实例化 Engine, 创建并建立连接,初始化
ChatManager 和 ChannelManager |
Modifier and Type | Method and Description |
---|---|
ChannelManager |
getChannelManager()
获取 ChannelManager 的实例
|
ChatManager |
getChatManager()
获取 ChatManager 的实例
|
Connection |
getConnection()
获取 Connection 的实例
|
static Context |
getContext() |
EngineOptions |
getEngineOptions()
获取 Engine 的配置
|
com.tuisongbao.engine.engineio.sink.EngineDataSink |
getSink() |
com.tuisongbao.engine.common.entity.ResponseError |
getUnhandledResponseError() |
public Engine(Context context, EngineOptions options)
ChatManager
和 ChannelManager
context
- 应用级别的 Contextoptions
- Engine 的配置public static Context getContext()
public EngineOptions getEngineOptions()
public ChatManager getChatManager()
ChatManager
实例public ChannelManager getChannelManager()
ChannelManager
实例public Connection getConnection()
Connection
实例public com.tuisongbao.engine.engineio.sink.EngineDataSink getSink()
public com.tuisongbao.engine.common.entity.ResponseError getUnhandledResponseError()