ImportsSystem.NetImportsSystem.Text.EncodingPublicClassForm1Dim publisher AsNew Sockets.UdpClient(0)Dim subscriber AsNew Sockets.UdpClient(2000)PrivateSubTimer1_Tick_1(ByVal sender As System.Object,ByVal e As System.EventArgs)HandlesTimer1.TickTryDim ep As IPEndPoint =NewIPEndPoint(IPAddress.Any,0)Dimrcvbytes()As Byte = subscriber.Receive(ep)
TextBox4.Text = ASCII.GetString(rcvbytes)Catch ex AsExceptionEndTryEndSubPrivateSubForm1_Load_1(ByVal sender As System.Object,ByVal e As System.EventArgs)HandlesMyBase.Load
subscriber.Client.ReceiveTimeout =100
subscriber.Client.Blocking =FalseEndSubPrivateSubButton1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)HandlesButton1.Click
publisher.Connect(TextBox1.Text, TextBox2.Text)Dimsendbytes()As Byte = ASCII.GetBytes(TextBox3.Text)
publisher.Send(sendbytes, sendbytes.Length)EndSubEnd Class