oneRain 2020-03-30 14:45:41 +08:00
parent 02e84e69d8
commit 60cd97c725
1 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ namespace LeanCloud.Realtime.Internal.WebSocket {
TaskCompletionSource<GenericCommand> tcs = new TaskCompletionSource<GenericCommand>(); TaskCompletionSource<GenericCommand> tcs = new TaskCompletionSource<GenericCommand>();
request.I = RequestI; request.I = RequestI;
responses.Add(request.I, tcs); responses.Add(request.I, tcs);
LCLogger.Debug($"{id} => {request.Cmd}/{request.Op}: {request.ToString()}"); LCLogger.Debug($"{id} => {request.Cmd}/{request.Op}: {request}");
ArraySegment<byte> bytes = new ArraySegment<byte>(request.ToByteArray()); ArraySegment<byte> bytes = new ArraySegment<byte>(request.ToByteArray());
try { try {
ws.SendAsync(bytes, WebSocketMessageType.Binary, true, default); ws.SendAsync(bytes, WebSocketMessageType.Binary, true, default);
@ -92,7 +92,7 @@ namespace LeanCloud.Realtime.Internal.WebSocket {
} while (!result.EndOfMessage); } while (!result.EndOfMessage);
try { try {
GenericCommand command = GenericCommand.Parser.ParseFrom(data); GenericCommand command = GenericCommand.Parser.ParseFrom(data);
LCLogger.Debug($"{id} <= {command.Cmd}/{command.Op}: {command.ToString()}"); LCLogger.Debug($"{id} <= {command.Cmd}/{command.Op}: {command}");
_ = HandleCommand(command); _ = HandleCommand(command);
} catch (Exception e) { } catch (Exception e) {
// 解析消息错误 // 解析消息错误