[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] winsock error strings: evutil_socket_error_to_string versus FormatMessage



I noticed the following comment in evutil_socket_error_to_string in evutil.c:

/* XXXX Is there really no built-in function to do this? */

The answer is yes, the built-in function FormatMessage will do this for you. I'm happy to submit a patch that will change evutil_socket_error_to_string to call FormatMessage, if you like. The only potential downside is that the messages evutil_socket_error_to_string currently returns are short and sweet, while the messages from FormatMessage are quite a bit longer. Not sure if that's a disadvantage or not.

Here's a comparison of the strings returned by the two different mechanisms:

https://gist.github.com/ppelleti/4735862

--Patrick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.