From d4973876384be55df64de45db8a511d1e0330872 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 23 六月 2021 17:06:20 +0800
Subject: [PATCH] 房间小图列表
---
HDL_ON/DAL/DriverLayer/UdpSocket.cs | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
index 3ffb628..4946986 100644
--- 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,17 +39,16 @@
}
}
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")));
+ busSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(IPAddress.Parse("239.0.168.188")));
}
catch{
busSocket = null;
--
Gitblit v1.8.0