Преглед на файлове

Merge branch 'develop' of https://github.com/chkr1011/MQTTnet into develop

release/3.x.x
Christian Kratky преди 6 години
родител
ревизия
ac60ed4559
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. +4
    -2
      Source/MQTTnet/Implementations/MqttTcpServerListener.cs

+ 4
- 2
Source/MQTTnet/Implementations/MqttTcpServerListener.cs Целия файл

@@ -70,16 +70,18 @@ namespace MQTTnet.Implementations
#endif
clientSocket.NoDelay = true;

SslStream sslStream = null;

if (_tlsCertificate != null)
{
var sslStream = new SslStream(new NetworkStream(clientSocket), false);
sslStream = new SslStream(new NetworkStream(clientSocket), false);
await sslStream.AuthenticateAsServerAsync(_tlsCertificate, false, SslProtocols.Tls12, false).ConfigureAwait(false);
}

var protocol = _addressFamily == AddressFamily.InterNetwork ? "ipv4" : "ipv6";
_logger.Verbose($"Client '{clientSocket.RemoteEndPoint}' accepted by TCP listener '{_socket.LocalEndPoint}, {protocol}'.");

var clientAdapter = new MqttChannelAdapter(new MqttTcpChannel(clientSocket, null), new MqttPacketSerializer(), _logger);
var clientAdapter = new MqttChannelAdapter(new MqttTcpChannel(clientSocket, sslStream), new MqttPacketSerializer(), _logger);
ClientAccepted?.Invoke(this, new MqttServerAdapterClientAcceptedEventArgs(clientAdapter));
}
catch (ObjectDisposedException)


Зареждане…
Отказ
Запис