Ejemplo n.º 1
0
        public static void SendPacket(Packet packet, SslStream stream)
        {
            try
            {
                ProtoFire reply  = new ProtoFire(packet);
                byte[]    result = reply.Encode();

                if (packet.msgType == MessageType.NOTIFICATION)
                {
                    LogNotification(packet);
                }
                else
                {
                    LogResponse(packet);
                }

                stream.Write(result, 0, result.Length);
                stream.Flush();
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public static void SendPacket(Packet packet, SslStream stream)
        {
            try
            {
                ProtoFire reply = new ProtoFire(packet);
                byte[] result = reply.Encode();

                if (packet.msgType == MessageType.NOTIFICATION)
                {
                    LogNotification(packet);
                }
                else
                {
                    LogResponse(packet);
                }

                stream.Write(result, 0, result.Length);
                stream.Flush();
            }
            catch (Exception ex)
            {
                Log.Error(ex.ToString());
            }
        }