| Page 46 of 59 |
Appendix 3. WinSock Error Messages
The following is a list of possible error codes returned by the WSAGetLastError call, along with their extended explanations. Errors are listed in alphabetical order of error macro. Error codes defined in WINSOCK2.H not returned from any function have not been listed here.
Macro | Code | Message | Description |
|
|
|
| |||
|
|
| An attempt was made to access a | |||||||
|
|
| socket in a way forbidden by its | |||||||
|
| Permission | access permissions. An example is | |||||||
WSAEACCES | 10013 | using | a | broadcast | address for | |||||
denied. | ||||||||||
|
| sendto |
| without | broadcast | |||||
|
|
|
| |||||||
|
|
| permission | being | set | using | ||||
|
|
| setsockopt (SO_BROADCAST). | |||||||
|
|
| Only one usage of each socket | |||||||
|
|
| address | (protocol/IP | address/port) | |||||
|
|
| is normally permitted. This error | |||||||
|
|
| occurs if an application attempts to | |||||||
|
|
| bind a socket to an IP address/port | |||||||
|
|
| that has already been used for an | |||||||
|
|
| existing socket, or a socket that | |||||||
|
|
| wasn't closed properly, or one that | |||||||
|
|
| is still in the process of closing. | |||||||
|
|
| For server applications that need to | |||||||
|
|
| bind multiple sockets to the same | |||||||
|
| Address | port | number, | consider | using | ||||
WSAEADDRINUSE | 10048 | setsockopt | (SO_REUSEADDR). | |||||||
already in use | ||||||||||
|
| Client applications usually need not | ||||||||
|
|
| ||||||||
|
|
| call bind at all - connect will | |||||||
|
|
| choose | an | unused | port | ||||
|
|
| automatically. When bind is called | |||||||
|
|
| with a | |||||||
|
|
| ADDR_ANY), |
|
| a | ||||
|
|
| WSAEADDRINUSE error could be | |||||||
|
|
| delayed until the specific address is | |||||||
|
|
| "committed." | This could | happen | |||||
|
|
| with a call to other functions later, | |||||||
|
|
| including |
| connect, | listen, | ||||
|
|
| WSAConnect or WSAJoinLeaf. | |||||||
|
|
| The requested address is not valid | |||||||
|
|
| in its context. Normally results from | |||||||
|
|
| an attempt to bind to an address | |||||||
|
| Cannot assign | that is not valid for the local | |||||||
WSAEADDRNOTAVAIL | 10049 | machine. This can also result from | ||||||||
requested | connect, sendto, WSAConnect, | |||||||||
|
| address | ||||||||
|
| WSAJoinLeaf, | or | WSASendTo | ||||||
|
|
| ||||||||
|
|
| when the remote address or port is | |||||||
|
|
| not valid for a remote machine (e.g. | |||||||
|
|
| address or port 0). |
|
|
FieldServer Technologies 1991 Tarob Court Milpitas, California 95035 USA Web:www.fieldserver.com Tel: (408)