robbiet480 / go.nut

A Golang library for interacting with NUT (Network UPS Tools)
https://godoc.org/github.com/robbiet480/go.nut
MIT License
31 stars 15 forks source link

Check if the response generates an error #1

Closed kwkoo closed 6 years ago

kwkoo commented 6 years ago

If the call the read the response from the server generates an error, we should return from the function instead of looping indefinitely.

I had a situation where the NUT master's ACL wasn't configured correctly. The master would close the socket connection whenever the client tried to connect. This would cause the client to be stuck in a busy loop.

robbiet480 commented 6 years ago

Thank you!