Skip to content

Commit

Permalink
fix: adds separate delimiter for tcp client
Browse files Browse the repository at this point in the history
  • Loading branch information
aknous committed Feb 9, 2024
1 parent d3e5b4e commit c8274b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Pdu-Wattbox-Lib/WattboxSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c8274b6

Please sign in to comment.