In ApcupsdClient.ExecuteClientAction, I added a Thread.Sleep(20) to handle a case when the buffer does not have enough data to read the next line (in my testing, only seen with the GetEvents call). This can probably be achieved by using a read buffer as the data is being received in chunks.
The NIS protocol (how the APCUPS daemon responds) has the first byte 0x00, second byte is the length of the line, remainder are the line itself, and the line is ended with a newline character. The entire response ends with 0x00 0x00.
In ApcupsdClient.ExecuteClientAction, I added a
Thread.Sleep(20)
to handle a case when the buffer does not have enough data to read the next line (in my testing, only seen with the GetEvents call). This can probably be achieved by using a read buffer as the data is being received in chunks.The NIS protocol (how the APCUPS daemon responds) has the first byte
0x00
, second byte is the length of the line, remainder are the line itself, and the line is ended with a newline character. The entire response ends with0x00 0x00
.