Example #1
0
        bool SendInternal(Memory <byte> data, bool rethrow, Socket socket,
                          GameEncryptionSession encryption, bool server)
        {
            return(RunGuarded(rethrow, server, () =>
            {
                lock (_encryptionLock)
                    if (encryption != null)
                    {
                        encryption.Encrypt(data);
                    }

                lock (socket)
                    socket.SendFull(data.GetArray());
            }));
        }
Example #2
0
        bool SendInternal(byte[] data, int length, bool rethrow, Socket socket,
                          GameEncryptionSession encryption, bool server)
        {
            return(RunGuarded(rethrow, server, () =>
            {
                if (encryption != null)
                {
                    lock (encryption)
                        encryption.Encrypt(data, 0, length);
                }

                lock (socket)
                    socket.SendFull(data, 0, length);
            }));
        }