Issue Information
-
#000117
-
0 - None Assigned
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
Originally posted by theultramage
http://www.eathena.w...ker&showbug=117
Currently socket error messages look like this:
This is very user-unfriendly, and even more so because these codes vary from system to system. Printing the error message would help users determine problems without digging through system headers or posting new topics in the forums.
For unix, there are the standard strerror(), and maybe strerror_r() functions. For Windows there's the winapi FormatMessage?() function (avoid strerror() since it doesn't handle socket codes).
A 'const char* errmsg(int code)' helper function should do the job. Problem is that the system will only provide messages into a prepared buffer, not directly as const*, therefore a static buffer will probably have to be used.
http://www.eathena.w...ker&showbug=117
Currently socket error messages look like this:
[Error]: bind failed (socket 5, code 98)!
This is very user-unfriendly, and even more so because these codes vary from system to system. Printing the error message would help users determine problems without digging through system headers or posting new topics in the forums.
For unix, there are the standard strerror(), and maybe strerror_r() functions. For Windows there's the winapi FormatMessage?() function (avoid strerror() since it doesn't handle socket codes).
A 'const char* errmsg(int code)' helper function should do the job. Problem is that the system will only provide messages into a prepared buffer, not directly as const*, therefore a static buffer will probably have to be used.