コード例 #1
0
        /// <summary>
        /// Sends the message.
        /// </summary>
        /// <param name="message">The byte array.</param>
        public void SendMessage(byte[] message)
        {
            if (messagesThread == null)
            {
                messagesThread = new Thread(MessagesThreadWork);

                messagesThread.IsBackground = true;

                messageQueue = new QueueWithBlock <byte[]>();

                messagesThread.Start();
            }

            messageQueue.Enqueue(message);
        }
コード例 #2
0
        public static void TrySendMessage(string message)
        {
            if (messagesThread == null)
            {
                messagesThread = new Thread(MessagesThreadWork);

                messagesThread.IsBackground = true;

                messageQueue = new QueueWithBlock <string>();

                messagesThread.Start();
            }

            messageQueue.Enqueue(message);
        }