oneRain 2020-06-24 13:56:28 +08:00
parent c358fd4de9
commit 4f38ce0615
2 changed files with 4 additions and 3 deletions

View File

@ -52,9 +52,6 @@
<Compile Include="..\Realtime\Internal\Controller\LCIMConversationController.cs">
<Link>Internal\Controller\LCIMConversationController.cs</Link>
</Compile>
<Compile Include="..\Realtime\Internal\Controller\LCIMGoAwayController.cs">
<Link>Internal\Controller\LCIMGoAwayController.cs</Link>
</Compile>
<Compile Include="..\Realtime\Internal\Router\LCRTMServer.cs">
<Link>Internal\Router\LCRTMServer.cs</Link>
</Compile>

View File

@ -70,8 +70,10 @@ namespace LeanCloud.Realtime.Internal.Connection {
private LCWebSocketClient ws;
private State state;
// 可以在 connecting 状态时拿到 Task并在重连成功后继续操作
private Task connectTask;
// 共享这条连接的 IM Client
private readonly Dictionary<string, LCIMClient> idToClients;
internal LCConnection(string id) {
@ -193,8 +195,10 @@ namespace LeanCloud.Realtime.Internal.Connection {
}
} else {
if (command.Cmd == CommandType.Echo) {
// 心跳应答
heartBeat.Pong();
} else if (command.Cmd == CommandType.Goaway) {
// 针对连接的消息
Reset();
} else {
// 通知