Socket Error Summary (turn)

Source: Internet
Author: User
Tags call back network function socket error connection reset win32
Socket Error Summary (EXT) comes from:

Socket Error 0-directly send error
Socket Error 10004-interrupted function call
Socket Error 10013-permission denied
Socket Error 10014-bad Address
Socket Error 10022-invalid argument
Socket error 10024-too many open files
Socket Error 10035-resource temporarily unavailable
Socket error 10036-operation now in progress
Socket error 10037-operation already in progress
Socket error 10038-socket operation on Non-socket
Socket Error 10039-destination address required
Socket Error 10040-message too long
Socket error 10041-protocol wrong type for socket
Socket Error 10042-bad protocol option
Socket Error 10043-protocol not supported
Socket error 10044-socket type not supported
Socket Error 10045-operation not supported
Socket error 10046-protocol Family not supported
Socket error 10047-address family not supported by protocol family
Socket error 10048-address already in use
Socket Error 10049-cannot Assign requested address
Socket Error 10050-network is down
Socket Error 10051-network is unreachable
Socket error 10052-network dropped connection on reset
Socket error 10053-software caused connection abort
Socket error 10054-connection Reset by peer
Socket error 10055-no Buffer space available
Socket error 10056-socket is already connected
Socket error 10057-socket is not connected
Socket error 10058-cannot send after socket shutdown
Socket Error 10060-connection timed out
Socket Error 10061-connection refused
Socket Error 10064-host is down
Socket error 10065-no route to host
Socket Error 10067-too many processes
Socket Error 10091-network subsystem is unavailable
Socket error 10092-winsock. DLL version out of range
Socket error 10093-successful WSAStartup not yet performed
Socket error 10094-graceful shutdown in progress
Socket error 11001-host not found
Socket error 11002-non-authoritative Host not found
Socket error 11003-this is a non-recoverable error
Socket error 11004-valid name, no data record of requested type

Wsaeaddrinuse (10048) address already
Wsaeconnaborted (10053) Software caused connection abort
Wsaeconnrefused (10061) Connection refused
Wsaeconnreset (10054) Connection Reset by peer
Wsaedestaddrreq (10039) Destination address required
Wsaehostunreach (10065) No route to host
Wsaemfile (10024) Too many open files
Wsaenetdown (10050) network is down
Wsaenetreset (10052) network dropped connection
Wsaenobufs (10055) No buffer space available
Wsaenetunreach (10051) network is unreachable
Wsaetimedout (10060) Connection timed out
Wsahost_not_found (11001) Host not FOUND
Wsasysnotready (10091) network sub-system is unavailable
Wsanotinitialised (10093) WSAStartup () not performed
Wsano_data (11004) Valid name, no DATA of that type
Wsano_recovery (11003) non-recoverable query error
Wsatry_again (11002) non-authoritative host found
wsavernotsupported (10092) wrong WinSock DLL version
Common socket Error return code (EXT)

Wsaeintr (10004) is called by the interrupted system

When a intercept Winsock function is interrupted by the WSACancelBlockingCall (), this resistive intercept function gets the error message of WSAEINTR this message. The reader should note that when your program is useful for WSACancelBlockingCall to interrupt intercept functions, you have to write a code for this intercept function to handle WSAEINTR error messages, or your program may have an unpredictable error. "----"

In principle, all functions that can be intercept in a blocking style can have this bug.

WSAEBADF (10009) wrong file codes

In the Berkeley socket interface, the file descriptor and the socket descriptor are interlinked, and opening the socket can be imagined as opening a file. The meaning of WSAEBADF in the Berkeley socket interface is the error socket descriptor, which may be a socket that has not been opened or a closed socket.

There is a common error code wsaenotsock in the Winsock that specifies the wrong socket descriptor. Please refer to the Wsaenotsock section for details.

Wsaeacces (10013) No such rights

For the Berkeley socket interface function, the reason for this error is usually to open a file or socket that does not have open permissions. For example, on UNIX, a typical user cannot open a Sock_raw socket, which is typically a super User (super users). If the average user opens the socket for Sock_raw, it will get this error message.

For the Winsock API function interface, the function of this error is two: Send () and sendto (). When sending data using Send () or sendto (), the destination address is set to a broadcast address, but a wsaeacces error is made when you do not call setsockopt () to configure the So_broadcast option.

Wsaefault (10014) the wrong memory address

The system detected the use of the wrong memory address. When calling the Winsock function, the parameters are often referred to in a standard way, which may point to a structure, such as a sockaddr_in structure, or to a resource-slow zone. This error is wsaefault when the program accidentally spreads into a bug that is not indicated by the error memory. Also, this error occurs when the memory block that the target points to is too small.

Wsaeinval (10022) Parameters error

If the incorrect parameters are transferred to the Winsock function, it will cause wsaeinval this error. If the reference is an indicator of a structure, the structure fills in the incorrect value, which also causes this error. For example, the How () parameters of the shutdown () function can only be 0, 1, or 2, and if set to other values, this error will appear.

In the web design, calls between functions and functions usually have a certain order, and this error can also be seen in the past without the order of the line. Below is a detailed description of each of the related functions.

function of
The time when the mistake happened

Accept ()
No successful call to listen () before calling accept ()

Bind ()
The bind () function was successfully called to specify the name of the Stocket

Getstockname ()
No call to bind () function to specify the name of the socket

Listen ()
is already in the connection state or the socket does not call bind () function specifies the socket name

Recv () and Recvfrom ()
For datagram Socket,socket, no call bind () function specifies IP address, port and protocol, etc. for stream socket, connection not established

Send () and sendto ()
For datagram Socket,socket, no call bind () function specifies IP address, port and protocol, etc. for stream socket, connection not established

In principle, there is a certain range of values that can be set by the parameters of all functions, or there are certain values, and these functions are likely to have this error.

Wsaemfile (10024) Too many open files

The explanation of the Burke socket interface is that many files have been opened, exceeding the limit of the file opening. The opening of the file and socket in the Berkeley socket is described by the file descriptor (file descriptor). Winsock for sockets is not a file, wsaemfile in Winsock meaning is to open too many sockets.

This program usually leads to more than one network program in the same machine, so that many sockets are opened. Another error that can be avoided is that the application does not have a normal closed socket so that the socket resource is consumed.

Wsaewouldblock (10035) function-type action resistance intercept

The function is done in a intercept form, and this error is present when the function of the function is returned and its functions have not yet been completed. For example, the false send () sends a piece of data to the remote host in a intercept, and the dummy function returns wsaewouldblock this error, which means that this piece of information cannot be sent out in this once send () function call.

For the Connect () function, this error indicates that the remote host has not been successfully connected, and the connection requirements are in progress. If you use the setsockopt () function in your program to so_linger the time limit, you may find this error when calling Closesocket ().

For unsynchronized network data Functions (WSAASYNCGETXXXXBYYYYY ()), the Wsaewouldblock error is obtained, indicating that the network information to be checked is currently not available. This is usually a temporary error, and the application may succeed by calling the same function later.

Wsaeinprogress (10036) resistive intercept function is being executed.

For each process or thread,winsock, only "one" is allowed to execute the Intercept type function. If the blocking intercept function is executing and calls to the Winsock function, the function returns the wsaeinprogress error.

This error also occurs in functions that require a long time, such as Connect (). There is a situation where the "non-resistive Intercept" connect () function is performed twice, due to the Intercept connect (), the first call back Wsaewouldblock error. This requires that the connection not be completed, and the second connect () call will get a wsaeinprogress error.

Our advice is to add wsaisblocking () to determine whether a intercept function is being executed before it is possible to have this wrong function call. If so, we may need to cancel the Intercept function, or cancel what we want to do.

Wsaealready (10037) function completed

This error means a great difference in the interpretation of the Berkeley socket interface and the Winsock function. The interpretation of the Burke socket interface is that the function is completed; In Winsock, wsaealready means: "The asynchronous event you want to cancel has been canceled." "When you call Wsacancelasyncrequest () to cancel an asynchronous event, the event has been canceled.

Wsaenotsock (10038) Illegal socket

Usually the Winsock function is to be entered with the socket descriptor, and the function gets wsaenotsock error if the socket represented by this socket descriptor is either not correctly opened or not opened at all. In principle, a function that has been transferred with the socket descriptor is likely to have a wsaenosock error.

Wsaedestaddrreq (10039) need to address the location

When you want to transmit data to a remote machine, you must specify the address (and port, etc.) of the opposite party to be delivered. Check to see if your application is correctly filling the sockaddr structure of the opposite party when calling connect () or sendto ().

Wsaemsgsize (10040) The message is too long, and the buffer zone cannot tolerate

This error is due to the fact that the information is too large and the buffer zone is not able to tolerate it, where the buffer zone may be specified by the user or the inner part of the system. There are four functions that will happen to this bug:

function of
The time when the mistake happened

Recv (), Recvform ()
When receiving data using the datagram socket, if the recv (), Recvform () specifies a less-than-expected slow-moving region to receive the incoming datagram, the long datagram will be discarded and told the function wsaemsgsize this error

Send (), sendto ()
When using datagram socket to transmit data, if the data being sent is greater than the maximum length that Winsock can transmit to datagram, then send () and sendto () return the error message of Wsaemsgsiz

Wsaeprototype (10041) wrong protocol stereotypes

The reason for the error is that when the socket () function call specifies the Winsock not supported protocol for example, you may not set the steam socket (SOCK_STREAM) as a UDP protocol (IPPRO_UDP). The stream socket does not support UDP communication protocol. If you really want to test it, the program intentionally calls the socket (): Hsock=socket (Af_inet, Sock_stream, IPPROTO_UDP); you will notice that the socket () A function call gets a wsaeprotonosupport error. That's obviously not right, and it's supposed to get wsaeprototype this mistake. Wsaeprototype This error specifies the error protocol, and the protocol specified is supported by the address family, but is not appropriate for the socket type. " In the above example, the UDP protocol belongs to the Af_inet address family, but it cannot be used on a STREAM socket (sock_stream socket). Wsaeprotonosupport This error indicates that the specified protocol is not supported by the family and that the meaning is somewhat different from the wsaeprototype.

In fact, the difference between Wsaeprototype and Wsaeprotonosupport is negligible. When the Internet is developed, both of these bugs represent the same situation--specifying the error.

Anyway, you can never try to wsaeprototype this bug.

Wsaenoprotoopt (10042) Error Protocol options (option)

This error is primarily for getsockopt () and setsockopt () functions. These two functions can have different functions depending on the parameters. There are some limitations to each option, such as some options that can only be used in stream sockets, while others can only be used in datagram sockets. If you violate these restrictions, you will have this error. Please look at the following table:





Datagram Socket (SOCK_DGRAM) does not support these options





Some vendors ' Winsock TCP/IP protocol core does not support these options



These options are suitable only for getsockopt () functions that do not function in setsockopt ()

Wsaeprotonosupport (10043) non-supported protocol

Winsock the core does not support the specified communication protocol. For example, when you use the socket () function, the second argument is specified as Sock_stream, and the third argument is ipproto_icmp, so the socket () call gets wsaeprotonosupport this error. WinSock 1. Version 1 does not support ICMP protocol, so calling the socket () to specify ICMP this protocol will result in bugs. In fact, it's not just the case that produces wsaeprotonpsupport errors, Wsaeprototype.

Wsaesocktnosupport (10044) non-supported socket type

The Winsock version currently in use does not support the socket type specified by the function. For example, it is completely rooted in the Winsock of the Winsock 1.1 edition of the spec book, and does not support SOCK_RAW this socket type. When you call the socket () function, the address family chooses Af_inet (pf_inet) and the socket type does not select Sock_raw, and this error occurs.

Some of the Winsock that have been developed by the manufacturers also offer a number of different functions in addition to supporting the Winsock version 1.1 specifications. We recommend that if you need to use these extra features when you are developing your program, consider the compatibility issues with other environmental problems.

Wsaeopnotsupp (10045) function does not support this type of socket

function does not support current socket type. For example, the Accept () and listen () functions can only function in a connected socket (stream socket), or on a stream socket. For recv (), Recvform (), send (), and sendto () functions, Msg_oob can only be used for connection-directed sockets.

Wsaepfnosupport (10046) non-supported protocol family

The current Winsock core does not support the assigned family. This error is similar to Wsaeafnosupport, which is now replaced by Wsaeafnosupport, who can take part in the Wsaeafnosupport.

Wsaeafnosupport (10047) An address family that is not supported

The specified address family is not supported with the protocol. For the socket () function, the error occurs because of the function error's parameters. For the function of sockaddr, the reason for the error is often that the network protocol does not support the address family specified in the SOCKADDR structure (sin_family).

The Wsaeaddrinuse (10048) address has been specified

The specified "address" is in use. The address here refers to the name of the socket, which contains three parts: protocol, port, and IP addresses. The reason for this error is usually that the application attempts to use the bind () function to specify port, which is already occupied by other applications. This situation occurs when a server program that performs two identical qualities (designating the same socket name) on the same host, and the second program gets this error message because the first program occupies a port first.

There is also a common situation where you use bind () to specify the port of the socket when writing a client program, and this error happens. It is not possible to specify the port of the socket with bind (), but to specify whether any other program is in use when the program is executed. The bind () function is rarely called in a client program, and the general client program allows the system to help you select an appropriate port.

In addition, the application can use the SO_REUSEADDR option of setsockopt () and allow port to be reused, but we do not encourage this. This may cause the TCP/IP core to be disturbed in the program.

Wsaeaddrnotavail (10049) Unable to refer to the location of the address

The reason for the error is usually to specify the address that the robot should not have. The address here contains three parts: the network protocol, port, and IP addresses.

In the Berkeley socket interface, when calling bind (), this error can be found if the specified IP address is not the address of the local machine. When you call connect () or sendto (), if the sin_port in the sockaddr_in structure fills in "0", it also causes this error (Eaddrnotavail error on Unxi).

For Winsock functions, the time of the bug and the function of the Berkeley socket, bind () and connect () all cause this error.

For Winsock functions, the time of the bug and the function of the Berkeley socket, bind () and connect () all cause this error. The WinSock version of the 1.1 edition does not mention that the bind () function leads to wsaeaddrnotavail errors, and bind () also leads to this error, as we test the results.

Wsaenetdown (10050) network wrong

The next layer of the network system problems, Winsock functions can not be executed. This is a serious problem, which makes almost all the Winsock function calls fail. If your Winsock function is wrong, then you should check your network card, network card driver and your Winsock to fix the core.

Wsaenetunreach (10051) is not connected to the specified network

In the Berkeley socket interface, this error means that it is impossible to contact the network system. In Winsock 1. In the 1 spec, Wsaenetunreach is connected to the Ethostunreach in the interface of the Berkeley socket.

Wsaenetreset (10052) The internet has been reset

Re-open the wrong side of the machine. This error is obtained by the function of the local host calling and sending data. For the setsockopt () function, the reason for this error is the connection to the So_keepalive (timeout) that was attempted.

Wsaeconnaborted (10053) interrupted connection

The TCP/IP protocol will be connected after the connection is established, when there is a reason why the TCP/IP protocol core is constantly being sent back to the data and the failure is being sent. At this time, the application will receive wsaconnaborted this error.

Wsaeconnreset (10054) connection has been reset by the opposite side

The connection has been forced by the system. TCP/IP protocol core If you detect the connection problem of a stream socket, it will convey a message to the opposite side. " This time the equation will get wsaeconnreset error messages.

Wsaenobufs (10055) The small

The Winsock core is not equipped with enough of the buffer zone to perform the procedure. This error occurs with the entire Windows System resource. If the entire Windows itself is available with little resources, there are fewer programs that can be executed at the same time. It is also possible to perform a "bad" application with no normal use and a system resource (such as memory). or the abnormal shutdown of some applications, which also occupies the system resource.

Wsaeisconn (10056) socket is connected

The network function usually has a certain call order, and some function calls can not be called after success, or it will be wrong. When the connection was established, the client program called () succeeded, and the server program called Accept () successfully. This time, if the client program calls a connect () function again, it will get wsaeisconn this error, indicating that the socket is already connected. This error can also appear if the client program calls the Listen () function, which means that the function should not be called at this time. For the server program, if the socket is already in the connection state, the program calls the Connect () function and gets wsaeisconn this error.

The error is created on the stream socket because the stream socket is connected. For datagram sockets, multiple successful Connect () function calls are allowed (for the Datdgram socket, the call Connect () function is not intended to establish a connection). The reason for this error in the datagram socket is that on the SendTo () function, when a call to SendTo () is sent to datagram, if a inaddr_any ("") is filled in to the azimuth address, port is filled in at 0 (in Sockaddr_ In the structure), it will cause wsaeisconn this error.

Wsaenotconn (10057) socket not connected

The network function usually has a certain call order, some functions must call the success of a function before calling. Wsaenotconn the reason for this error is obvious, is that before the connection is established, you try to obtain data from the connection or transfer information to the parties, you will be wsaenetconn this error.

For example, for a stream socket, if you call Send () to send data before the connection is made, or call recv () to get the data, you will get this bug that tells you that the socket has not yet been connected. If you call the Getpeername () This function to try to get the socket connected to the side, you will also find this error. For setsockopt () This function, if the set so_keepalive, but the connection has been interrupted, it will also appear wsaenetconn this error.

A beginner may not check for a function call error after calling connect (), so that it is not known whether the connection is being established.

Wsaeshutdown (10058) socket closed

What this error means is that it is impossible to transmit the data again because the socket has been closed by the shutdown () function. When you use Shutdown () to close the socket, the TCP/IP protocol core of Winsock closes the function of sending or receiving the socket. One thing to note is that this error will only appear in the stream socket.

Wsaetoomanyrefs (10059) Participation (reference) too much, resource consumption

The explanation in the UNIX operating system is that the system's core resource consumption is exhausted. Not a single function in the Winsock 1.1 edition of the spec book would have this error.

Wsaetimedout (10060) connected to timeout (timeout)

When the program tries to connect a remote host with connect (), the host does not respond, and after a while, the TCP/IP protocol core is passed back to the Connect () function wsaetimedout this error message. The reason for this error may be that the system of the remote host to which the program is connected is a problem, or that there is no host at all. There is also a possible reason for the problem with the local robot's network system, which causes the local host to be unable to connect to the remote host. Check your network system settings to see what is not the case, such as the 閘 (gateway) settings, the main machine name table (hosts) in the name of the host and the network address of the error and so on.

Wsaeconnrefused (10061) connect to accept rejection

Connection requirements are not subject to the machine's return to the opposite side of the connection. This error is not a problem with the network system, but the connection requirements of the server program that rejects the client program, or the existence of this server program. When the TCP/IP core receives a connection request, it looks at whether there is a server program in the system that the port is connected to, and if there is no such server program, tcp/ The IP core will return an wsaeconnrefused to the equation.

There are usually several reasons for this error. The user may be connected to the wrong remote host or to the wrong port, possibly the remote host and port, but the server program is not executed. Check to see if the SOCKADDR_IN structure in the program has not been filled out? The IP address and port in the sockaddr_in are arranged in the network bit order.

Wsaeloop (10062) Too many symbol-type links (symbolic link)

In the UNIX operating system, this error is meant to refer to a number of symbolic link (links).

Wsaenametoolong (10063) file name

In the UNIX operating system, this error means that the path name (including the file name) that you want to open the file for is too long.

Wsaehostdown (10064) close to the party's main machine

The reason for this error in the interpretation of the Berkeley socket interface is when the remote host is shut down or the system is in question.

Wsaehostunreach (10065) is not connected to the host machine

In the Berkeley socket interface, this error means that there is no way to get in touch with the host machine. In the Winsock aspect, there is a kind of error code, the reader can refer to Wsaenetunreach this error.

Wsaeproclim (10067) Too many processes.

A Windows Sockets implementation may have a limit on the number of applications ' may use it simultaneously. WSAStartup () may fail with this error if the limit has been reached.

Wsasysnotready (10091) The host network system is not yet ready

The network system of the local landlord machine has not been able to function properly. If this error occurs, the reader may want to check for a file that has no WINSOCK.DLL (or a 32-bit version of WSOCK32.DLL). Is this file stored in a correct path?

Wsavernotsupported (10092) The WinSock.DLL version error is not supported because the Winsock version specified when calling the WSAStartup () function is not supported by the available Winsock version. If this error occurs, the reader must decide how the Winsock version of the local Windows system and the version of the version can be supported, and so on. Newer versions of the Winsock are usually available to support newer versions of the new version, and recommendations can be used with newer Winsock versions.

Wsanotinitialised (10093) not performed WSAStartup ()

The application does not call WSAStartup () or call WSAStartup () failure. The application must successfully call WSAStartup () to use WinSock.DLL, or it will have this error message.

Wsaediscon (10101) graceful shutdown in progress.

Returned by WSARecv (), WSARecvFrom () to indicate the remote party has initiated a graceful shutdown.

Wsatype_not_found (10109) Class type not FOUND

The specified class is not found.

Wsahost_not_found (11001) has proven to be unable to find the host machine

This error occurs when you use the Web data function to search for the Shing machine, and the host does not exist. The most common way to find a network master is to first look for the local host's web name list (the host file), if you can't find a way through DNS again, if you can't find it, you'll often get back to the function.

When this happens, check to see if the local host's host name is not a problem with the translator's settings. The more likely problem is that the DNS is set up to set the wrong DNS server. If DNS server is correct, make sure that DNS server does not run. You can use Ping to see if DNS server is running or not, and if you don't ping this program, you can try to explain a certain existing host and see if DNS server is in normal working order.

Wsatry_again (11002) No network information was found, but it was not proven

This is a temporary error that tells you you can't find the Web information you're looking for, so you can try again.

Wsano_recovery (11003) mistakes that can't be saved

The reason for this error is the error caused by the network domain Name System, DNS, in relation to the name of the host machine. These bugs include DNS Formerr, refused, and Notimp, and please refer to the RFC1035 domain Name System file.

The reason for this error in the search for service and protocol data is that there is no data library to store the network data. This library is typically a file on a local host, such as services and protocol.

Wsano_data (11004) name is legal, but no such information is found

The search format is correct, but there is no such information. This is usually a temporary error that can be found in a different network data server. "

Wsaproviderfailedinit (OS dependent) Unable to initialize a service provider.

Either a service provider ' s DLL could not to be loaded (LoadLibrary () failed) or the provider ' s Wspstartup/nspstartup functio N failed.

Wsasyscallfailure (OS dependent) System call failure.

Returned when a system call that should never fail does. For example, if a call to WaitForMultipleObjects () fails or one of the registry APIs fails trying to manipulate the

Protocol/namespace catalogs.

Wsa_invalid_handle (OS dependent) Specified Event object HANDLE is INVALID.

An application attempts to use a event object, but the specified handle is not valid.

Wsa_invalid_parameter (OS dependent) One or more parameters are INVALID.

A application used a WinSock function which directly maps to a WIN32 function. The WIN32 function is indicating a problem with one or more parameters.

Wsainvalidproctable (OS dependent) Invalid procedure table from service provider.

A service provider returned a bogus proc table to Ws2_32.dll. (usually caused by one or more of the function pointers being NULL.)

Wsainvalidprovider (OS dependent) Invalid service provider version number.

A service provider returned a version number other than 2.2.

Wsa_io_incomplete (OS dependent) overlapped I/O event object not in signaled state.

The application has tried to determine the status of a overlapped operation which is not yet completed. Applications "Use WSAGetOverlappedResult ()" (with the FWAIT flag set to False) in a polling mode to determine when a O Verlapped operation has completed'll get this error code until the operation is complete.

Wsa_io_pending (OS dependent) overlapped operations'll complete later.

The application has initiated an overlapped operation which is cannot completed. A completion indication would be given in a later time to operation has been.

Wsa_not_enough_memory (OS dependent) insufficient MEMORY available.

A application used a WinSock function which directly maps to a WIN32 function. The WIN32 function is indicating a lack of required memory resources.7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.