Implement IDisposable for CommandStream
This commit is contained in:
@@ -10,7 +10,7 @@ namespace PlantBox.Shared.Communication
|
||||
/// <summary>
|
||||
/// Wrap a <see cref="NetworkStream"/> to send <see cref="CommandPacket"/> easily, see Wiki > Protocol
|
||||
/// </summary>
|
||||
public class CommandStream
|
||||
public class CommandStream : IDisposable
|
||||
{
|
||||
private NetworkStream _stream;
|
||||
|
||||
@@ -23,6 +23,14 @@ namespace PlantBox.Shared.Communication
|
||||
_stream = networkStream;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Release resources associated with the underlying stream
|
||||
/// </summary>
|
||||
public void Dispose()
|
||||
{
|
||||
_stream.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read a <see cref="CommandPacket"/> from the stream
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user