Spinach.SwarmConnection.Send_ChatMsg C# (CSharp) Method

Send_ChatMsg() public method

public Send_ChatMsg ( string chatMsg, string Username ) : void
chatMsg string
Username string
return void
        public void Send_ChatMsg(string chatMsg, string Username)
        {
            try
            {
                Thread t = null;
                MessageGenerator mMsg = new MessageGenerator();
                //Chat username to be included
                string msg = mMsg.msgChat(chatMsg, mSocket.GetIP() + ":" + mSocket.GetPort());
                AsynchronousClient client = new AsynchronousClient();
                client.SetMultiMsg(mSocket.GetIPtoPeer(), msg, mSocket.GetIP() + ":" + mSocket.GetPort());
                t = new Thread(new ThreadStart(client.SendMultiClientChat));
                t.IsBackground = true;
                t.Start();
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Failed to send chat message.");
            }
        }