@@ -65,9 +65,11 @@ namespace TimberWinR.Inputs
|
||||
private void HandleNewClient(object client)
|
||||
{
|
||||
var tcpClient = (TcpClient)client;
|
||||
NetworkStream clientStream = tcpClient.GetStream();
|
||||
NetworkStream clientStream = null;
|
||||
do
|
||||
{
|
||||
clientStream = tcpClient.GetStream();
|
||||
var stream = new StreamReader(clientStream);
|
||||
|
||||
string line;
|
||||
while ((line = stream.ReadLine()) != null)
|
||||
{
|
||||
@@ -76,12 +78,15 @@ namespace TimberWinR.Inputs
|
||||
JObject json = JObject.Parse(line);
|
||||
ProcessJson(json);
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
LogManager.GetCurrentClassLogger().Error(ex);
|
||||
}
|
||||
if (CancelToken.IsCancellationRequested)
|
||||
break;
|
||||
}
|
||||
} while (!CancelToken.IsCancellationRequested);
|
||||
|
||||
clientStream.Close();
|
||||
tcpClient.Close();
|
||||
Finished();
|
||||
|
||||
Reference in New Issue
Block a user