Fix broker disposing client
This commit is contained in:
@@ -52,9 +52,9 @@ namespace PlantBox.Broker
|
|||||||
|
|
||||||
private void ClientLoop(TcpClient client)
|
private void ClientLoop(TcpClient client)
|
||||||
{
|
{
|
||||||
using (var commandStream = new CommandStream(client.GetStream()))
|
try
|
||||||
{
|
{
|
||||||
try
|
using (var commandStream = new CommandStream(client.GetStream()))
|
||||||
{
|
{
|
||||||
while (client.Connected)
|
while (client.Connected)
|
||||||
{
|
{
|
||||||
@@ -79,10 +79,12 @@ namespace PlantBox.Broker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
client.Close();
|
||||||
Log($"Client disconnected: {ex.Message}");
|
}
|
||||||
}
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log($"Client disconnected: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user