From 0446635ed62fadfea18cec490fcb52a72676a31f Mon Sep 17 00:00:00 2001 From: Christian Kratky Date: Sat, 14 Nov 2020 10:35:08 +0100 Subject: [PATCH] Add comments. --- Source/MQTTnet/Implementations/CrossPlatformSocket.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/MQTTnet/Implementations/CrossPlatformSocket.cs b/Source/MQTTnet/Implementations/CrossPlatformSocket.cs index 8d80b1a9..afc5fe60 100644 --- a/Source/MQTTnet/Implementations/CrossPlatformSocket.cs +++ b/Source/MQTTnet/Implementations/CrossPlatformSocket.cs @@ -33,6 +33,9 @@ namespace MQTTnet.Implementations public bool NoDelay { + // We cannot use the _NoDelay_ property from the socket because there is an issue in .NET 4.5.2, 4.6. + // The decompiled code is: this.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.Debug, value ? 1 : 0); + // Which is wrong because the "NoDelay" should be set and not "Debug". get => (int)_socket.GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay) > 0; set => _socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0); }