Beckhoff / ADS

Beckhoff protocol to communicate with TwinCAT devices.
MIT License
513 stars 194 forks source link

Sockets.cpp: Print errors on read() as string #73

Closed tboegi closed 5 years ago

tboegi commented 5 years ago

Some platforms allow to translate errno into a string by calling strerror() This allows to print messages like "Error: read frame failed with error: 54" in a much more user-friendly form like this: "Error: read frame failed with error: Connection reset by peer"

pbruenn commented 5 years ago

Good idea! It builds fine on all supported platforms. So I would like to include it without the #ifdef and add strerror for the second lastError in that file, too. If you give permission I would try to commit it in your name, or you send a new pull request with that changes and git commit --signoff

Thanks, Patrick

tboegi commented 5 years ago

Hej Patrick, The idea is inspired by other projects, so I can't even take credits for that.

For this PR: Please just commit it under your name, without the "ifdef", and I'll close this PR.

pbruenn commented 5 years ago

I forgot to add the tag to the commit, but this issue should be fixed by 82ebeaa7dc0311ddfdf12f58c38be8e5ac656840