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()); } }