/// <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); }
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); }