|
|
@@ -61,6 +61,8 @@ namespace MQTTnet.Implementations |
|
|
|
|
|
|
|
_socket = new Socket(_addressFamily, SocketType.Stream, ProtocolType.Tcp); |
|
|
|
|
|
|
|
// Usage of socket options is described here: https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.setsocketoption?view=netcore-2.2 |
|
|
|
|
|
|
|
if (_options.ReuseAddress) |
|
|
|
{ |
|
|
|
_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); |
|
|
@@ -68,7 +70,7 @@ namespace MQTTnet.Implementations |
|
|
|
|
|
|
|
if (_options.NoDelay) |
|
|
|
{ |
|
|
|
_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, true); |
|
|
|
_socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, true); |
|
|
|
} |
|
|
|
|
|
|
|
_socket.Bind(_localEndPoint); |
|
|
|