WSNPCover Appendix C: Error Reference

This is a hypertext version of Appendix C in the text Windows Sockets Network Programming, by Bob Quinn and Dave Shute. It contains a detailed description of all the errors defined by the WinSock specification, with suggestions on how to deal with them when they occur in an application.

The WinSock "WSA" error values are a significant part of the Windows Sockets API. Although there are a few exceptions, most WinSock functions can fail at times. A robust application will always verify the return value from a function call to check for failure. When a WinSock function fails, the resulting error value is the key to why it failed. And knowing why it failed is the key to finding a remedy or work-around.

In Chapter 14, "Do's and Don'ts," we describe when to expect errors (anytime), which errors to expect (any error) and how an application should handle them (tell the application user as much as you know). In Chapter 10, "Support Routines" we tell you how to retrieve and report errors using WSAGetLastError(). We also show you one way to display error strings with our own WSAperror() the sample WinSockx library in Chapter 7. In this appendix we tell you everything there is to know about the errors themselves.

After a quick review of where to get errors and which errors to expect--we list user-fixable errors (the only ones a user should ever see). The bulk of this appendix provides a detailed description of each WinSock error: what each error means, what causes them, and how to an application should deal with them. We wrap-up with a cross-reference list to use in case you have only the numeric value, not the text name.

[Go to Top]