Example #1
0
 private void textBox3_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyData == Keys.Enter)
     {
         if (textBox1.Text != "" && textBox3.Text != "")
         {
             Datagram msg = new Datagram(0);
             msg.AppendString(textBox1.Text);
             msg.AppendString(textBox3.Text);
             sendDatagram(msg);
             textBox3.Text = "";
         }
     }
 }
Example #2
0
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            Datagram data = new Datagram(1);

            data.AppendString(textBox1.Text);
            sendDatagram(data);
        }
Example #3
0
        void requestnextpart()
        {
            Datagram nextpart = new Datagram(3);

            nextpart.AppendString(rcvfile);
            nextpart.AppendInteger(rcvnextpart);
            Invoke(MessageUnicastSender, nextpart, rcvsender);
        }
Example #4
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            Datagram data = new Datagram(1);

            data.AppendString(textBox1.Text);
            Invoke(MessageSender, data);
            foreach (KeyValuePair <string, long> file in pubfiles)
            {
                Datagram filedatagram = new Datagram(2);
                filedatagram.AppendString(file.Key);
                filedatagram.AppendLong(file.Value);
                Invoke(MessageSender, filedatagram);
            }
        }