Ejemplo n.º 1
0
        void SendFrame(MemoryStream commands)
        {
            if (Connected)
            {
                Tuple <MemoryStream, bool> additionalCommands;
                while (m_pendingCommands.TryDequeue(out additionalCommands))
                {
                    if (additionalCommands.Item1.Length > 0)
                    {
                        m_connection.Send(additionalCommands.Item1, additionalCommands.Item2, false);
                    }
                }

                if (commands.Length > 0)
                {
                    m_connection.Send(commands, false, true);
                }
            }
            else
            {
                Tuple <MemoryStream, bool> additionalCommands;
                while (m_pendingCommands.TryDequeue(out additionalCommands))
                {
                }
            }
        }