From c8274b61da9cb7931afdf4d0fab9902a5e089734 Mon Sep 17 00:00:00 2001 From: Andrew Knous Date: Fri, 9 Feb 2024 11:51:08 -0500 Subject: [PATCH] fix: adds separate delimiter for tcp client --- Pdu-Wattbox-Lib/WattboxSocket.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Pdu-Wattbox-Lib/WattboxSocket.cs b/Pdu-Wattbox-Lib/WattboxSocket.cs index af668bb..84eafcb 100644 --- a/Pdu-Wattbox-Lib/WattboxSocket.cs +++ b/Pdu-Wattbox-Lib/WattboxSocket.cs @@ -10,6 +10,7 @@ public class WattboxSocket : IWattboxCommunications { private const string DelimiterOut = "\x0A"; private const string DelimiterIn = "\x0D\x0A"; + private const string DelimiterTcp = "\x0A"; private const string DelimiterUsername = ": "; public readonly IBasicCommunication Communication; private readonly TcpSshPropertiesConfig _config; @@ -242,7 +243,13 @@ public void ParseResponse(string data) _portGather.LineReceived -= PortGather_LineReceived; //logging in changes the delmiter we're looking for... - _portGather = new CommunicationGather(Communication, DelimiterIn); + if (Communication is GenericSshClient) + { + _portGather = new CommunicationGather(Communication, DelimiterIn); + } + else { + _portGather = new CommunicationGather(Communication, DelimiterTcp); + } _portGather.LineReceived += PortGather_LineReceived; Debug.Console(2, this, "sending password {0}", _config.Password);