nimbuscontrols / EIPScanner

Free implementation of EtherNet/IP in C++
https://eipscanner.readthedocs.io/en/latest/
MIT License
238 stars 98 forks source link

TCPSocket: handle EINTR error #91

Closed JohannesKauffmann closed 1 year ago

JohannesKauffmann commented 1 year ago

This error is non-fatal and should be handled by retrying.

With this, the error handling is moved before the logging and addition of the count variable. In case of error, len would be -1 on !windows, so it would add a negative value.

Errors other than EINTR are thrown as usual.

JohannesKauffmann commented 1 year ago

Maybe this also needs to happen for UDP, I'm not sure. The current UDPSocket::Receive implementation has no read loop anyway, so not sure how that works when EINTR is returned there...