TREConnection Class Reference

Inherits from TREObject : TREEventEmitter : NSObject
Declared in TREConnection.h

Overview

网络连接管理类。

可监听如下事件:

  • kTREEventConnectionStateChanged :连接状态变化时触发,处理方法可接收 NSDictionary 类型参数,结构如下:
  • kTREEventConnectionConnectingIn :通知下次重连是在多久以后,处理方法可接收 NSUInteger 类型参数。

  state

当前连接状态。

@property (nonatomic, readonly) TREConnectionState state

Declared In

TREConnection.h

– connect

建立连接。

- (void)connect

Discussion

仅用于调用 disconnect 后恢复连接,初始化 TREEngine 时不需要调用此方法,是自动的。

Declared In

TREConnection.h

– disconnect

断开连接。

- (void)disconnect

Declared In

TREConnection.h