using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SocketsUDP;
namespace WindowsApplication2
{
    public partial class Form1 : Form
    {
        
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CClientUDP ccu = new CClientUDP();
            CClientUDP ccus = new CClientUDP();
            ccu.ReceiveUdp("192.168.1.5", 2000);
            
            ccus.SendUdp(Encoding.UTF8.GetBytes(textBox1.Text), "192.168.1.4", 2001); 
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            textBox2.Text = Encoding.UTF8.GetString(ccu.ByteData);
        }
    }
}