fpagliughi / sockpp

Modern C++ socket library.
BSD 3-Clause "New" or "Revised" License
782 stars 126 forks source link

Regression: Failure in connect() no longer sets last_error #27

Closed snej closed 4 years ago

snej commented 4 years ago

A failure in connector::connect() or acceptor::open now leaves the last_error property at 0 instead of an actual error code.

This is a side effect of the fix of #23. socket::close now overwrites last_error with the status of the ::close call, which is almost always 0.

fpagliughi commented 4 years ago

Thanks. The unit tests caught a couple side effects. I figured there would be more.

I think we need more unit tests.

fpagliughi commented 4 years ago

Fixed by #28. I hope.