From 47fbfe1cd58bb82b45dfc0a5398799bd856b1fb0 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 25 十一月 2021 11:45:12 +0800
Subject: [PATCH] 2021-11-25=01
---
HDL_ON/DAL/DriverLayer/UdpSocket.cs | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/HDL_ON/DAL/DriverLayer/UdpSocket.cs b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
index ab3cb02..4f78319 100644
--- a/HDL_ON/DAL/DriverLayer/UdpSocket.cs
+++ b/HDL_ON/DAL/DriverLayer/UdpSocket.cs
@@ -46,10 +46,9 @@
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;
@@ -136,7 +135,7 @@
//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绔彛鐨勬暟鎹�
{
--
Gitblit v1.8.0