From 2bbb1b72dbce5cf9bd4ac4a5b7488e3f18eaf929 Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期六, 19 十二月 2020 18:37:38 +0800 Subject: [PATCH] 2020-12-19 1.IOS和Android网络切换,远程和本地控制切换优化。 2.IOS和Android后台回到前台,搜索网关,远程和本地控制切换优化. --- HDL_ON/DAL/DriverLayer/UdpSocket.cs | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs old mode 100644 new mode 100755 index 3ffb628..ab3cb02 --- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs +++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs @@ -21,7 +21,7 @@ //鏈湴Socket private Socket busSocket; - int _port = 0; + public int Port = 0; /// <summary> /// 鍚姩Socket鎺ユ敹鍜屽彂閫佸姛鑳� /// </summary> @@ -29,7 +29,7 @@ { if (IsRunning) { - if (port == _port) + if (port == Port) { return; } @@ -39,15 +39,15 @@ } } if (port != 0) - _port = port; - if (_port == 0) + Port = port; + if (Port == 0) return; 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"))); } -- Gitblit v1.8.0