Skip to content

Remove Thread.Sleep in ApcupsdClient.ExecuteClientAction #1

@patrickhampson

Description

@patrickhampson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions