Today in the use of Winsock and encountered this problem, on the internet to find a lot, there is an explanation.
The requested address is not valid in its environment. It is usually generated when the bind () function attempts to lash a local machine's illegal address to a socket. It may also occur when connect (), SendTo (), WSAConnect (), Wsajoinleaf (), or wsasendto () function calls are illegal (such as 0 addresses or 0 port numbers) because of remote machine remote address or port number. "Very much and own reason, in earnest looked, found it was set to empty when setting remotehost. The Windows sockets error code Extension Description is attached below
Wsaeacces (10013) Permission denied.
An attempt was made to access a socket using a blocked access right. For example, use function sendto () to send data to a broadcast address on a socket that does not have the So_broadcast command set broadcast permissions using the function setsockopt ().
<?xml:namespace prefix = o ns = "Urn:schemas-microsoft-com:office:office"/>
Wsaeaddrinuse (10048) address already.
Normally each socket address (protocol/IP address/port number) is allowed to be used only once. This error occurs when an application attempts to use the bind () function to lashing an IP address/port number that is used by an existing or not fully closed or closed socket to a new socket. For server applications, consider using the setsockopt () function's SO_REUSEADDR command if you need to use the bind () function to lash multiple sockets onto the same port. Client applications generally do not have to use the bind () function--connect () function to always automatically select the unused port number. When the bind () function operates with a wildcard address (including Addr_any), the error wsaeaddrinuse may delay until an explicit address has been committed. This may occur when subsequent functions such as connect (), listen (), WSAConnect (), or wsajoinleaf () are invoked.
Wsaeaddrnotavail (10049) cannot assign requested address.
The requested address is not valid in its environment. It is usually generated when the bind () function attempts to lash a local machine's illegal address to a socket. It may also occur when connect (), SendTo (), WSAConnect (), Wsajoinleaf (), or wsasendto () function calls are illegal (such as 0 addresses or 0 port numbers) because of remote machine remote address or port number.
Wsaeafnosupport (10047) address family is not supported by protocol family.
The address being used is incompatible with the requested protocol. All sockets are created in association with an address family (such as the IP Protocol af_inet) and a generic protocol type (such as Sock_stream). This error returns if an incorrect protocol is explicitly required in the socket () call, or when a function such as sendto () is invoked with the address of the address family that is the wrong socket.
Wsaealready (10037) Operation already in progress.
This error occurs when an operation is already in progress on a non-blocking socket and an action is attempted on it. For example, the Connect () function is called the second time on a non-blocking socket that is being connected, or an asynchronous request (WSAASYNCGETXBYY ()) that has been canceled or completed is canceled.
Wsaeconnaborted (10053) Software caused connection abort.
An established connection was terminated by the software on your host, possibly due to a data transfer timeout or protocol error.
Wsaeconnrefused (10061) Connection refused.
The connection could not be established because the target host is actively rejecting it. This is typically because an attempt is made to connect to a service that is not active on a remote host, such as if no server application is in execution state.
Wsaeconnreset (10054) Connection reset by peer.
The existing connection was forcibly closed by the remote host. This is usually caused by a sudden shutdown of the peer application on the remote host, or by a reboot of the remote host, or by the remote host using "Force" on the remote side socket (see setsockopt (So_linger)). Additionally, if one or more operations are in progress, this error can also be caused if the connection is interrupted because of a failure detected by the "keep-alive" activity. At this point, the operation in progress is returned with the error code wsaenetreset failure, and subsequent operations will fail back to the error code wsaeconnreset.
Wsaedestaddrreq (10039) destination address required.
The address required for an operation on the socket was omitted. For example, this error is returned if the SendTo () function is invoked and the remote address is addr_any.
Wsaefault (10014) bad address.
The system detected that a pointer parameter that the call attempted to use pointed to an illegal pointer address. This error occurs if the application passes an illegal pointer value, or the buffer length is too small. For example, a parameter is a struct sockaddr, but the length of the parameter is less than sizeof (struct sockaddr).
Wsaehostdown (10064) Host is down.
The socket operation failed to return because the destination host was shut down. The socket operation encountered an inactive host. Network activity on the local host is not initialized. These conditions appear to be more appropriate by the error code wsaetimedout instructions.
Wsaehostunreach (10065) No route to host.
An attempt was made to perform a socket operation with an unreachable host. See Wsaenetunreach.
Wsaeinprogress (10036) Operation now in progress.
A blocking operation is executing. Windows sockets allows only one task (or thread) to have an outstanding blocking operation at the same time, and if any function is called at this point (whether or not the function references the socket or any other socket), this function will return with the error code wsaeinprogress.
Wsaeintr (10004) interrupted function call.
The blocking operation was interrupted by a function wsacancelblockingcall () call.
Wsaeinval (10022) Invalid argument.
An illegal parameter was provided (for example, an illegal level was specified when using the setsockopt () function). In some instances, it may also be related to the current state of the socket, for example, the Accept () function is invoked when the socket is not using listen () to listen.
Wsaeisconn (10056) Socket is already connected.
The connection request occurs on a socket that is already connected. Some implementations return this error for the use of the SendTo () function on connected Sock_dgram sockets (for Sock_stream sockets, the to parameter of the SendTo () function is ignored), although some other implementations treat the operation as a legitimate event.
Wsaemfile (10024) Too many open files.
Too many sockets are open. The Windows sockets implementation may have a maximum number of socket handles available, whether for the entire system or for each process or thread.
Wsaemsgsize (10040) message too long.
A message sent on a datagram socket is larger than the internal message buffer or some other network limit, or the buffer used to accept the datagram is less than the datagram itself.
Wsaenetdown (10050) network is down.
The socket operation encountered an inactive network. This error may indicate a serious failure of the network system (for example, the protocol stack that the Winsock DLL is running), the network interface, or the local network itself.
Wsaenetreset (10052) network dropped connection on reset.
The connection was interrupted because "keep-alive" detected a failure while the operation was in progress. It may also be returned by the setsockopt () function if you attempt to use it to set so_keepalive on a connection that has failed.
Wsaenetunreach (10051) network is unreachable.
A socket operation was attempted with a network that was unreachable. It often means that the local software does not know the route to the remote host.
Wsaenobufs (10055) No buffer space available.
The operation on the socket cannot be performed because the system lacks sufficient buffer space or because the queue is full.
Wsaenoprotoopt (10042) bad protocol option.
An unknown, illegal, or unsupported option or layer (level) was specified in the getsockopt () or setsockopt () call.
Wsaenotconn (10057) Socket is not connected.
Because the socket is not connected, the request to send or receive data is not allowed, or the sendto () function is used to send on the datagram socket without providing an address. Any other type of operation can also return this error, for example, by using the setsockopt () function to set so_keepalive on a reset connection.
Wsaenotsock (10038) Socket operation on Non-socket.
The operation was not attempted on a socket. It may be that the socket handle parameter does not refer to a legitimate socket, or the member in a fd_set is illegal when the Select () function is invoked.
Wsaeopnotsupp (10045) Operation not supported.
An attempted operation is not supported for the type of the referenced object. Typically, it occurs on a socket descriptor that does not support this operation on a socket, for example, an attempt to receive a connection on a datagram socket.
Wsaepfnosupport (10046) Protocol family not supported.
The protocol cluster is not configured in the system or does not support its implementation presence. It is somewhat different from the Wsaeafnosupport, but is interchangeable in most cases, and the descriptions of all Windows Sockets functions that return both errors are described in Wsaeafnosupport.
Wsaeproclim (10067) Too many processes.
The Windows sockets implementation may limit the number of applications that use it concurrently, and if this limit is reached, the WSAStartup () function may fail because of the error.
Wsaeprotonosupport (10043) Protocol not supported.
The requested protocol is not configured in the system or does not support its implementation existence. For example, the socket () call requests a SOCK_DGRAM socket, but specifies a stream protocol.
Wsaeprototype (10041) Protocol wrong type for socket.
The protocol specified in the socket () function call does not support the semantics of the requested socket type. For example, the ARPA Internet UDP protocol cannot be specified with the SOCK_STREAM socket type.
Wsaeshutdown (10058) cannot send after socket shutdown.
The send or receive request in this direction is not allowed because the socket has been closed in the corresponding direction by the previous shutdown () call. By calling the shutdown () function to request a partial shutdown of the socket, it sends a signal to stop sending or receiving or bidirectional operations.
Wsaesocktnosupport (10044) Socket type not supported.
The type of socket specified in this address family is not supported. For example, an optional socket type Sock_raw is selected in the socket () invocation, but the implementation does not support SOCK_RAW type sockets at all.
Wsaetimedout (10060) Connection timed out.
The connection request failed because the connected party did not respond correctly within a time period, or the connection was established because the connected host failed to respond.
Wsatype_not_found (10109) Class type not FOUND
The specified class was not found.
Wsaewouldblock (10035) Resource temporarily unavailable.
This error is returned by an operation that cannot be completed immediately on a non-blocking socket, for example, when the recv () function is called when no queued data is readable on the socket. This error is not a critical error, and the appropriate action should be retried later. Reporting Wsaewouldblock is normal for calling the Connect () function on non-blocking sock_stream sockets because it takes some time to establish a connection.
Wsahost_not_found (11001) Host not FOUND.
The host is unknown. This name is not a formal hostname, nor is it an alias, and it cannot be found in the queried database. This error may also be returned in the protocol and Service query, which means that the specified name cannot be found in the relevant database.
Wsa_invalid_handle (OS dependent) Specified Event object HANDLE is INVALID.
The application attempted to use an event object, but the specified handle was illegal.
Wsa_invalid_parameter (OS dependent) One or more parameters are INVALID.
The application uses a Winsock function that maps directly to the WIN32 function, and the WIN32 function indicates that one or more parameters are problematic.
Wsainvalidproctable (OS dependent) Invalid procedure table from service provider.
The service provider returned a fake Ws2_32.dll program (procedure) table. This is usually caused by one or more function pointers being empty.
Wsainvalidprovider (OS dependent) Invalid service provider version number.
The service provider returns a version number that is different from 2.2.
Wsa_io_incomplete (OS dependent) overlapped I/O event object not in signaled state.
The application attempted to detect a state of an overlapping operation that did not complete. The application uses the function WSAGetOverlappedResult () (parameter fwait set to false) to get this error code when polling mode detects whether an overlapping operation is complete, unless the operation is completed.
Wsa_io_pending (OS dependent) overlapped operations'll complete later.
The application has initialized an overlapping operation that cannot be completed immediately. The completion instructions will be available when this operation is completed later.
Wsa_not_enough_memory (OS dependent) insufficient MEMORY available.