mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
Try to fix CI builds.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
@@ -27,6 +28,7 @@ namespace MQTTnet.Implementations
|
|||||||
public CrossPlatformSocket(Socket socket)
|
public CrossPlatformSocket(Socket socket)
|
||||||
{
|
{
|
||||||
_socket = socket ?? throw new ArgumentNullException(nameof(socket));
|
_socket = socket ?? throw new ArgumentNullException(nameof(socket));
|
||||||
|
_networkStream = new NetworkStream(socket, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool NoDelay
|
public bool NoDelay
|
||||||
@@ -196,7 +198,13 @@ namespace MQTTnet.Implementations
|
|||||||
|
|
||||||
public NetworkStream GetStream()
|
public NetworkStream GetStream()
|
||||||
{
|
{
|
||||||
return _networkStream;
|
var networkStream = _networkStream;
|
||||||
|
if (networkStream == null)
|
||||||
|
{
|
||||||
|
throw new IOException("The socket is not connected.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return networkStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|||||||
Reference in New Issue
Block a user