| | |
| | | FindGateWaySocket.BeginSend(new System.Net.IPEndPoint(broadcastIpAddress, 7624), broadBytes); |
| | | } |
| | | } |
| | | catch { } |
| | | catch
|
| | | { |
| | | //关闭Socket,下次发送会自动连接
|
| | | FindGateWaySocket.Stop();
|
| | | } |
| | | System.Threading.Thread.Sleep(500); |
| | | } |
| | | }) |
| | |
| | | //标记当前网关是主网关 |
| | | gateWay.getGatewayBaseInfo.IsMainGateWay = true; |
| | | } |
| | | }
|
| | |
|
| | | //测试能否广播得到网关,通常情况下不检测
|
| | | if (Shared.Phone.UserCenter.UserCenterResourse.HideOption.CheckCanReceiveGateway == 1)
|
| | | {
|
| | | if (Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest.ContainsKey(id) == false)
|
| | | {
|
| | | if (gateWay == null)
|
| | | {
|
| | | Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest[id] = zbGateWay;
|
| | | }
|
| | | else
|
| | | {
|
| | | Shared.Phone.UserCenter.UserCenterResourse.DicReceiveGatewayTest[id] = gateWay;
|
| | | }
|
| | | }
|
| | | } |
| | | } |
| | | } |
| | | catch { } |
| | | catch |
| | | { |
| | | //关闭Socket,下次发送会自动连接 |
| | | FindGateWaySocket.Stop(); |
| | | } |
| | | } |
| | | #endregion |
| | | } |