Esempio n. 1
0
        private void SendMessage(NetworkMessage message, bool useEncryption)
        {
            if (useEncryption)
                message.PrepareToSend(xteaKey);
            else
                message.PrepareToSendWithoutEncryption();

            try
            {
                stream.BeginWrite(message.Buffer, 0, message.Length, null, null);
            }
            catch (ObjectDisposedException)
            {
                Close();
            }
        }