| | |
| | | busSocket = new Socket (AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); |
| | | busSocket.EnableBroadcast = true; |
| | | try { |
| | | //busSocket.Bind (new IPEndPoint (IPAddress.Any, 6000)); |
| | | busSocket.Bind(new IPEndPoint(IPAddress.Any, Port)); |
| | | busSocket.Bind(new IPEndPoint(IPAddress.Any, Port)); |
| | | |
| | | busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188"))); |
| | | busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188"))); |
| | | } |
| | | catch{ |
| | | busSocket = null; |
| | |
| | | //mqtt连接数据读取 A协议网络设备信息读取回复 处理 |
| | | if (((IPEndPoint)packet.RemoteEndPoint).Port == 8585) |
| | | { |
| | | Control.Ins.ConvertReceiveData(bytes); |
| | | Control.Ins.ConvertReceiveData(bytes, ((IPEndPoint)packet.RemoteEndPoint).Address.ToString()); |
| | | } |
| | | else if(((IPEndPoint)packet.RemoteEndPoint).Port == 6000)//处理bus 6000端口的数据 |
| | | { |