Exemple #1
0
        public void Send(OutPacket packet)
        {
            byte[] data = packet.Finalize();

            // TODO: switch to asynchronous send
            lock (SendLock)
                connection.Client.Send(data);

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);
        }
Exemple #2
0
        public void Send(OutPacket packet)
        {
            byte[] data = packet.Finalize();

            // TODO: switch to asynchronous send
            lock (SendLock)
                connection.Client.Send(data);

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);

            //Game.UI.LogLine(string.Format("Sent packet {0}", packet.Header.Command));
        }
Exemple #3
0
        public void Send(OutPacket packet)
        {
            LastOutOpcode = packet.Header.Command;
            byte[] data = packet.Finalize(authenticationCrypto);

            try
            {
                connection.Client.Send(data, 0, data.Length, SocketFlags.None);
            }
            catch (ObjectDisposedException ex)
            {
            }
            catch (EndOfStreamException ex)
            {
            }

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);
        }
Exemple #4
0
        public void Send(OutPacket packet)
        {
            lastOutPacket = packet;
            byte[] data = packet.Finalize(authenticationCrypto);

            try
            {
                connection.Client.BeginSend(data, 0, data.Length, SocketFlags.None, null, null);
            }
            catch (ObjectDisposedException ex)
            {
                Game.UI.LogException(ex);
            }
            catch (EndOfStreamException ex)
            {
                Game.UI.LogException(ex);
            }

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);
        }
Exemple #5
0
        public void Send(OutPacket packet)
        {
            LastOutOpcode = packet.Header.Command;
            byte[] data = packet.Finalize(authenticationCrypto);

            try
            {
                connection.Client.Send(data, 0, data.Length, SocketFlags.None);
            }
            catch(ObjectDisposedException ex)
            {
                Game.UI.LogException(ex);
            }
            catch(EndOfStreamException ex)
            {
                Game.UI.LogException(ex);
            }

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);
        }
Exemple #6
0
        public void Send(OutPacket packet)
        {
            byte[] data = packet.Finalize();

            // TODO: switch to asynchronous send
            lock (SendLock)
                connection.Client.Send(data);

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);
        }
        public void Send(OutPacket packet)
        {
            byte[] data = packet.Finalize();

            // TODO: switch to asynchronous send
            lock (SendLock)
                connection.Client.Send(data);

            Interlocked.Add(ref transferred, data.Length);
            Interlocked.Add(ref sent, data.Length);

            //Game.UI.LogLine(string.Format("Sent packet {0}", packet.Header.Command));
        }