Przeglądaj źródła

fixed nullpointer exception in server

release/3.x.x
JanEggers 7 lat temu
rodzic
commit
783ee4328a
2 zmienionych plików z 17 dodań i 0 usunięć
  1. +9
    -0
      Frameworks/MQTTnet.NetFramework/Implementations/MqttTcpChannel.cs
  2. +8
    -0
      Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs

+ 9
- 0
Frameworks/MQTTnet.NetFramework/Implementations/MqttTcpChannel.cs Wyświetl plik

@@ -17,14 +17,23 @@ namespace MQTTnet.Implementations
private Socket _socket;
private SslStream _sslStream;

/// <summary>
/// called on client sockets are created in connect
/// </summary>
public MqttTcpChannel()
{
}

/// <summary>
/// called on server, sockets are passed in
/// connect will not be called
/// </summary>
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)


+ 8
- 0
Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs Wyświetl plik

@@ -17,14 +17,22 @@ namespace MQTTnet.Implementations
private Socket _socket;
private SslStream _sslStream;

/// <summary>
/// called on client sockets are created in connect
/// </summary>
public MqttTcpChannel()
{
}

/// <summary>
/// called on server, sockets are passed in
/// connect will not be called
/// </summary>
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)


Ładowanie…
Anuluj
Zapisz