UdpClient Udp = new UdpClient(91);
private Thread thdUdp = new Thread(new ThreadStart(ListenUDPCenter));
thdUdp.IsBackground = true;
thdUdp.Start();
......
ServerIPoint = new IPEndPoint(IPAddress.Parse("192.168.0.2"),"200");
Udp.Send(bytes, bytes.Length, ServerIPoint);如果我改变发送地址或端口,例如
ServerIPoint = new IPEndPoint(IPAddress.Parse("192.168.0.2"),"201");
Udp.Send(bytes2, bytes2.Length, ServerIPoint);需要重新定义Udp吗?还是可以直接使用这个Udp?对于监听ListenUDPCenter有影响吗?
private Thread thdUdp = new Thread(new ThreadStart(ListenUDPCenter));
thdUdp.IsBackground = true;
thdUdp.Start();
......
ServerIPoint = new IPEndPoint(IPAddress.Parse("192.168.0.2"),"200");
Udp.Send(bytes, bytes.Length, ServerIPoint);如果我改变发送地址或端口,例如
ServerIPoint = new IPEndPoint(IPAddress.Parse("192.168.0.2"),"201");
Udp.Send(bytes2, bytes2.Length, ServerIPoint);需要重新定义Udp吗?还是可以直接使用这个Udp?对于监听ListenUDPCenter有影响吗?
就是可以否用一个udp发送多个地址及端口,另外是否会影响监听