msgChat() public method

public msgChat ( String chat, String ipport ) : String
chat String
ipport String
return String
コード例 #1
0
ファイル: Form1.cs プロジェクト: shranjan/pinac
        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);
        }
コード例 #2
0
ファイル: SwarmAPI.cs プロジェクト: shranjan/pinac
 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.");
     }
 }