Skip to content

SNMCRConnection

Ju Liaoyuan edited this page Dec 20, 2022 · 1 revision

SNMCRConnection Class Reference

  Inherits from SNConnection :
NSObject
  Declared in SNMCRConnection.h

SNMCRConnection.m

Tasks

Other Methods

– initWithConfigModel:

– updateConfigModel:

– enter

– sendWithMsgModel:

– onRoomMessage:session:

– onNotificationMessage:session:

– onConnectionStateChanged:session:

– onRoomStateChanged:session:

– onKickRoom:result:session:

– onEnterRoom:result:session:

– msgSubject

– connectionStateChanged

Extension Methods

  msgSubject property

  connectionStateChanged property

Properties

connectionStateChanged

连接状态改变回调。 返回值参见 SRConnState 枚举

@property (nonatomic, strong) RACSubject *connectionStateChanged

Discussion

连接状态改变回调。 返回值参见 SRConnState 枚举

Declared In

  • SNConnection.h

msgSubject

收到消息

@property (nonatomic, strong) RACSubject *msgSubject

Discussion

收到消息

Declared In

  • SNConnection.h

Instance Methods

connectionStateChanged

连接状态改变回调。 返回值参见 SRConnState 枚举

- (RACSubject *)connectionStateChanged

Discussion

连接状态改变回调。 返回值参见 SRConnState 枚举

Declared In

  • SNConnection.h

enter

进入长连房间

- (RACSignal *)enter

Discussion

进入长连房间

Declared In

  • SNConnection.h

initWithConfigModel:

初始化配置

- (instancetype)initWithConfigModel:(SNConfigModel *)*configModel*

Parameters

configModel
   后台下发配置,@see SNConfigModel

Discussion

初始化配置

Declared In

  • SNConnection.h

msgSubject

收到消息

- (RACSubject *)msgSubject

Discussion

收到消息

Declared In

  • SNConnection.h

onConnectionStateChanged:session:

连接状态

- (void)onConnectionStateChanged:(MercuryStatus)*state* session:(nonnull MCRRoomSession *)*session*

Parameters

state
   状态

Discussion

连接状态

Declared In

  • SNMCRConnection.m

onEnterRoom:result:session:

加入房间结果

- (void)onEnterRoom:(NSString *)*roomid* result:(nullable NSError *)*result* session:(MCRRoomSession *)*session*

Parameters

roomid
   房间ID

result
   nil,表示成功。

Discussion

加入房间结果

Declared In

  • SNMCRConnection.m

onKickRoom:result:session:

被动退出房间

- (void)onKickRoom:(NSString *)*roomid* result:(NSData *)*result* session:(nonnull MCRRoomSession *)*session*

Parameters

result
   退出原因

Discussion

被动退出房间

Declared In

  • SNMCRConnection.m

onNotificationMessage:session:

收到IM指令消息

- (void)onNotificationMessage:(MCRRoomModel *)*model* session:(nonnull MCRRoomSession *)*session*

Parameters

model
   消息内容

Discussion

收到IM指令消息

Declared In

  • SNMCRConnection.m

onRoomMessage:session:

收到IM普通消息

- (void)onRoomMessage:(MCRRoomModel *)*model* session:(nonnull MCRRoomSession *)*session*

Parameters

model
   消息内容

Discussion

收到IM普通消息

Declared In

  • SNMCRConnection.m

onRoomStateChanged:session:

房间状态

- (void)onRoomStateChanged:(MCRRoomSessionState)*state* session:(nonnull MCRRoomSession *)*session*

Parameters

state
   状态

Discussion

房间状态

Declared In

  • SNMCRConnection.m

sendWithMsgModel:

未实现 发送消息

- (RACSignal *)sendWithMsgModel:(SRMsgSendModel *)*msgModel*

Parameters

msgModel
   消息

Declared In

  • SNConnection.h

updateConfigModel:

更新配置

- (RACSignal *)updateConfigModel:(SNConfigModel *)*configModel*

Parameters

configModel
   配置,@see SNConfigModel

Discussion

更新配置

Declared In

  • SNConnection.h
Clone this wiki locally