Beispiel #1
0
        public void Send(PacketBase packet)
        {
            var writer = new PacketWriter();

            packet.Encode(writer);
            writer.Close(packet.PacketId);
            Socket.Send(writer.Buffer, writer.Pos, SocketFlags.None);
        }
Beispiel #2
0
        private void SendCommon(PacketBase packet)
        {
            var writer = new PacketWriter();

            packet.Encode(writer);
            writer.Close(packet.PacketId);
            lock (SendLock)
            {
                Socket.Send(writer.Buffer, writer.Pos, SocketFlags.None);
            }
        }