diff --git a/Frameworks/MQTTnet.NetFramework/Implementations/MqttTcpChannel.cs b/Frameworks/MQTTnet.NetFramework/Implementations/MqttTcpChannel.cs
index 037538c..bb17ee3 100644
--- a/Frameworks/MQTTnet.NetFramework/Implementations/MqttTcpChannel.cs
+++ b/Frameworks/MQTTnet.NetFramework/Implementations/MqttTcpChannel.cs
@@ -17,14 +17,23 @@ namespace MQTTnet.Implementations
private Socket _socket;
private SslStream _sslStream;
+ ///
+ /// called on client sockets are created in connect
+ ///
public MqttTcpChannel()
{
+
}
+ ///
+ /// called on server, sockets are passed in
+ /// connect will not be called
+ ///
public MqttTcpChannel(Socket socket, SslStream sslStream)
{
_socket = socket ?? throw new ArgumentNullException(nameof(socket));
_sslStream = sslStream;
+ _dataStream = (Stream)sslStream ?? new NetworkStream(socket);
}
public async Task ConnectAsync(MqttClientOptions options)
diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs
index 7f59a27..068f36c 100644
--- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs
+++ b/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs
@@ -17,14 +17,22 @@ namespace MQTTnet.Implementations
private Socket _socket;
private SslStream _sslStream;
+ ///
+ /// called on client sockets are created in connect
+ ///
public MqttTcpChannel()
{
}
+ ///
+ /// called on server, sockets are passed in
+ /// connect will not be called
+ ///
public MqttTcpChannel(Socket socket, SslStream sslStream)
{
_socket = socket ?? throw new ArgumentNullException(nameof(socket));
_sslStream = sslStream;
+ _dataStream = (Stream)sslStream ?? new NetworkStream(socket);
}
public async Task ConnectAsync(MqttClientOptions options)