|
|
@@ -86,7 +86,7 @@ namespace MQTTnet.Implementations |
|
|
|
try |
|
|
|
{ |
|
|
|
var clientSocket = await Task.Factory.FromAsync(_defaultEndpointSocket.BeginAccept, _defaultEndpointSocket.EndAccept, null); |
|
|
|
var clientAdapter = new MqttChannelCommunicationAdapter(new MqttTcpChannel(clientSocket, null), new DefaultMqttV311PacketSerializer()); |
|
|
|
var clientAdapter = new MqttChannelCommunicationAdapter(new MqttTcpChannel(clientSocket, null), new MqttV311PacketSerializer()); |
|
|
|
ClientConnected?.Invoke(this, new MqttClientConnectedEventArgs(clientSocket.RemoteEndPoint.ToString(), clientAdapter)); |
|
|
|
} |
|
|
|
catch (Exception exception) when (!(exception is ObjectDisposedException)) |
|
|
@@ -107,7 +107,7 @@ namespace MQTTnet.Implementations |
|
|
|
var sslStream = new SslStream(new NetworkStream(clientSocket)); |
|
|
|
await sslStream.AuthenticateAsServerAsync(_tlsCertificate, false, SslProtocols.Tls12, false); |
|
|
|
|
|
|
|
var clientAdapter = new MqttChannelCommunicationAdapter(new MqttTcpChannel(clientSocket, sslStream), new DefaultMqttV311PacketSerializer()); |
|
|
|
var clientAdapter = new MqttChannelCommunicationAdapter(new MqttTcpChannel(clientSocket, sslStream), new MqttV311PacketSerializer()); |
|
|
|
ClientConnected?.Invoke(this, new MqttClientConnectedEventArgs(clientSocket.RemoteEndPoint.ToString(), clientAdapter)); |
|
|
|
} |
|
|
|
catch (Exception exception) |
|
|
|