public msgChat ( String chat, String ipport ) : String | ||
chat | String | |
ipport | String | |
return | String |
private void Send_ChatMsg(object sender, EventArgs e) { Thread t = null; MessageGenerator mMsg = new MessageGenerator(); string msg = mMsg.msgChat(this.richTextBox1.Text, mSocket.GetIP() + ":" + mSocket.GetPort()); AsynchronousClient client = new AsynchronousClient(); client.SetMultiMsg(mSocket.GetIPtoPeer(), msg, mSocket.GetIP() + ":" + mSocket.GetPort()); t = new Thread(new ThreadStart(client.SendMultiClient)); t.Start(); t.IsBackground = true; //m.HandleChatMessages("Peer1", richTextBox1.Text); }
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."); } }