I tried to open already opened UDP port and ACE_SOCK_Dgram::open() failed.
As expected, strace shows that bind() failed and errno is set to EADDRINUSE.
To see what error happen, I used ACE_OS::last_error(), but it’s not updated.
I’d like to give informative error to user that the port already in use, instead of some general error.
Bonus question – when ACE_OS::last_error() can be used?
Tnx
I found the problem. I used ACE_OS::last_error() to macro (yes, macros are bad), which expanded to several links. One of the lines executed system call, and therefore value of errno changed