From ad3cc750067560629f827378e13b8693126a555f Mon Sep 17 00:00:00 2001 From: Piotrekol Date: Tue, 5 Mar 2019 13:01:46 +0100 Subject: [PATCH] Fix: trying to get stream for non-existing or time-outed connection --- plugins/TcpSocketDataSender/TcpSocketManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TcpSocketDataSender/TcpSocketManager.cs b/plugins/TcpSocketDataSender/TcpSocketManager.cs index 046cbfe6..8d38f15f 100644 --- a/plugins/TcpSocketDataSender/TcpSocketManager.cs +++ b/plugins/TcpSocketDataSender/TcpSocketManager.cs @@ -26,7 +26,7 @@ public virtual bool Connect() _tcpClient.Connect(IPAddress.Parse(ServerIp), ServerPort); _writer = new BinaryWriter(_tcpClient.GetStream()); } - catch (SocketException) + catch (Exception e) when (e is SocketException || e is InvalidOperationException) { //No server avaliable, or it is busy/full. return Connected = false;