protected void SetReplyCommand(CommandSession client, ICommand replayCmd, MessageReceivedEventArgs e, Guid requestGuid, ICommandParser cmdParser) { if (replayCmd != null) { WSCommandTypeBase replyCommandType = cmdParser.Create(); replayCmd.ToCommand(replyCommandType); replyCommandType.RequestID = requestGuid; cmdParser.SetReplyCommand(e, replyCommandType); if (IsAync) { //异步需要自己向Session发送消息 client.Session.SendMessage(cmdParser.ToBinary(replyCommandType), cmdParser.TransferEncoder); } } }