diff --git a/Controls/SerialOutputCoT.cs b/Controls/SerialOutputCoT.cs index 9fca6428bb..a067bd1eb4 100644 --- a/Controls/SerialOutputCoT.cs +++ b/Controls/SerialOutputCoT.cs @@ -171,7 +171,7 @@ void mainloop() if (CoTStream != null && CoTStream.IsOpen) { - CoTStream.WriteLine(xmlStr.Replace("\r", "")); + CoTStream.Write(xmlStr.Replace("\r", "")); } }); }); diff --git a/ExtLibs/Comms/CommsUDPSerialConnect.cs b/ExtLibs/Comms/CommsUDPSerialConnect.cs index d412640c56..0173fd7bf1 100644 --- a/ExtLibs/Comms/CommsUDPSerialConnect.cs +++ b/ExtLibs/Comms/CommsUDPSerialConnect.cs @@ -92,7 +92,11 @@ public void Open(string host, string port) if (IsInRange("224.0.0.0", "239.255.255.255", hostEndPoint.Address.ToString())) { log.Info($"UdpSerialConnect bind to port {Port}"); - client = new UdpClient(int.Parse(Port), hostEndPoint.AddressFamily); + + client = new UdpClient(); + client.ExclusiveAddressUse = false; + client.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); + client.Connect(hostEndPoint.Address, hostEndPoint.Port); IsOpen = true;