1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
|
Dim srcmsg As Byte()
Dim tgtmsg As Byte() = {68, 65, 84, 65, 52, 8, 0, 0, 0, 124, 68, 170, 59, 124, 68, 170, 62, 202, 54, 136, 61, 0, 192, 121, 196, 0, 192, 121, 196, 0, 192, 121, 196, 0, 192, 121, 196, 0, 192, 121, 196}
Dim eprx As New IPEndPoint(IPAddress.Parse("127.0.0.1"), 49001)
Dim eptx As New IPEndPoint(IPAddress.Parse("127.0.0.1"), 49000)
Dim clienttx As New UdpClient(AddressFamily.InterNetwork)
Dim clientrx As New UdpClient(AddressFamily.InterNetwork)
clientrx.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1)
clientrx.Client.Bind(eprx)
srcmsg = clientrx.Receive(eprx)
'This is where I got the values for tgtmsg from srcmsg
clienttx.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1)
clienttx.Client.Bind(eptx)
clienttx.Send(tgtmsg, tgtmsg.Length, eptx)
clienttx.Close()
|