Fix OnlyInstance Send Command Client bind address

This commit is contained in:
ChsBuffer
2021-02-26 13:35:37 +08:00
parent 146f2013ee
commit 677be9ba53

View File

@@ -62,7 +62,7 @@ namespace Netch.Utils
{
try
{
using var udpClient = new UdpClient(Global.Settings.UDPSocketPort);
using var udpClient = new UdpClient(new IPEndPoint(IPAddress.Loopback, Global.Settings.UDPSocketPort));
udpClient.Connect(IPAddress.Loopback, Global.Settings.UDPSocketPort);
var sendBytes = Encoding.ASCII.GetBytes(command.ToString());
await udpClient.SendAsync(sendBytes, sendBytes.Length);