public override bool Excute()
        {
            LogUtils.Trace($"开始处理消息:0x0212  From:{m_tcpClient.ToClient.RemoteEndPoint} Length:{((MemoryStream)m_data.BaseStream).Length}");
            bool ret = true;

            if (BinaryUtils.ReadBool(m_data))
            {
                //Port->Client
                Send_0x0212_ToClient sendPacket = new Send_0x0212_ToClient(BinaryUtils.ReadBytes(m_data));
                EasyOp.Do(() => {
                    m_tcpClient.ToClient.BeginSend(sendPacket.PackData());
                }, ex => {
                    LogUtils.Debug($"命令:0x0211 发送数据失败 Port->Server,目标Tcp连接已断开");
                    ret = false;
                });
            }
            else
            {
                //Client->Port
                Send_0x0212_ToPort sendPacket = new Send_0x0212_ToPort(BinaryUtils.ReadBytes(m_data));
                EasyOp.Do(() => {
                    m_tcpClient.ToClient.BeginSend(sendPacket.PackData());
                }, ex => {
                    LogUtils.Debug($"命令:0x0211 发送数据失败 Server->Port,目标Tcp连接已断开");
                    ret = false;
                });
            }
            return(ret);
        }
Esempio n. 2
0
 public override bool Excute()
 {
     LogUtils.Debug($"命令:0x0212 P2P(2端)数据转发 From:{m_tcpClient.ToClient.RemoteEndPoint} Length:{((MemoryStream)m_data.BaseStream).Length}");
     if (BinaryUtils.ReadBool(m_data))
     {
         //Port->Client
         Send_0x0212_ToClient sendPacket = new Send_0x0212_ToClient(BinaryUtils.ReadBytes(m_data));
         m_tcpClient.ToClient.Client.Send(sendPacket.PackData());
     }
     else
     {
         //Client->Port
         Send_0x0212_ToPort sendPacket = new Send_0x0212_ToPort(BinaryUtils.ReadBytes(m_data));
         m_tcpClient.ToClient.Client.Send(sendPacket.PackData());
     }
     return(true);
 }
Esempio n. 3
0
 public override bool Excute()
 {
     if (BinaryUtils.ReadBool(m_data))
     {
         //Port->Client
         LogUtils.Debug("[服务器]Port->Client");
         Send_0x0212_ToClient sendPacket = new Send_0x0212_ToClient(BinaryUtils.ReadBytes(m_data));
         m_tcpClient.ToClient.Client.Send(sendPacket.PackData());
     }
     else
     {
         //Client->Port
         LogUtils.Debug("[服务器]Client->Port");
         Send_0x0212_ToPort sendPacket = new Send_0x0212_ToPort(BinaryUtils.ReadBytes(m_data));
         m_tcpClient.ToClient.Client.Send(sendPacket.PackData());
     }
     return(true);
 }