The Data Connection Could Not Be Established: Wsaeaddrnotavail Cannot Assign Requested Address

Posted on
The Data Connection Could Not Be Established: Wsaeaddrnotavail Cannot Assign Requested Address 5,0/5 3070 reviews

I have it in the book-Appendix C - Winsock Error CodesThis appendix lists the Winsock error codes by error number. This list does not include the Winsock errors marked BSD-specific or undocumented. In addition, the Winsock errors that map directly to Win32 errors appear toward the end of this appendix.100040017WSAEINTRInterrupted function call. This error indicates that a blocking call was interrupted by a call to WSACancelBlockingCall.100090017WSAEBADFBad file handle.

This error means that the supplied file handle is invalid. Under Microsoft Windows CE, it is possible for the socket function to return this error, which indicates that the shared serial port is busy.100130017WSAEACCESPermission denied. An attempt was made to manipulate the socket, which is forbidden. This error most commonly occurs when attempting to use a broadcast address in sendto or WSASendTo, in which broadcast permission has not been set with setsockopt and the SOBROADCAST option.100140017WSAEFAULTInvalid address.

The pointer address passed into the Winsock function is invalid. This error is also generated when the specified buffer is too small.100220017WSAEINVALInvalid argument. An invalid argument was specified. For example, specifying an invalid control code to WSAIoctl will generate this error. Plus, it can indicate an error with the current state of a socket0017for example, calling accept or WSAAccept on a socket that is not listening.100240017WSAEMFILEToo many open files. Too many sockets are open. Typically, the Microsoft providers are limited only by the amount of resources available on the system.100350017WSAEWOULDBLOCKResource temporarily unavailable.

This error is most commonly returned on nonblocking sockets in which the requested operation cannot complete immediately. For example, calling connect on a nonblocking socket will return this error because the connection request cannot be completed immediately.100360017WSAEINPROGRESSOperation now in progress. A blocking operation is currently executing. Typically, you will not see this error unless you are developing 16-bit Winsock applications.100370017WSAEALREADYOperation already in progress. This error typically occurs when an operation that is already in progress is attempted on a nonblocking socket0017for example, calling connect or WSAConnect a second time on a nonblocking socket already in the process of connecting.

This error can also occur when a service provider is in the process of executing a callback function (for those Winsock functions that support callback routines).100380017WSAENOTSOCKSocket operation on an invalid socket. This error can be returned from any Winsock function that takes a SOCKET handle as a parameter. This error indicates that the supplied socket handle is not valid.100390017WSAEDESTADDRREQDestination address required. This error indicates that the supplied address was omitted. For instance, calling sendto with the destination address INADDRANY will return this error.100400017WSAEMSGSIZEMessage too long. This error can mean a number of things. If a message is sent on a datagram socket that is too large for the internal buffer, this error occurs.

It also occurs if the message is too large because of a network limitation. Finally, if upon receiving a datagram the buffer is too small to receive the message, this error is generated.100410017WSAEPROTOTYPEWrong protocol type for socket. A protocol was specified in a call to socket or WSASocket that does not support the semantics of the given socket type. For example, requesting to create an IP socket of type SOCKSTREAM and protocol IPPROTOUDP will generate this error.100420017WSAENOPROTOOPTBad protocol option. An unknown, unsupported, or invalid socket option or level was specified in a call to getsockopt or setsockopt.100430017WSAEPROTONOSUPPORTProtocol not supported. Either the requested protocol is not installed on the system or no implementation exists for it.

For example, if TCP/IP is not installed on the system, attempting to create either a TCP or a UDP socket will generate this error.100440017WSAESOCKTNOSUPPORTSocket type not supported. Support for the specified socket type does not exist for the given address family. For example, requesting a socket of type SOCKRAW for a protocol that does not support raw sockets will generate this error.100450017WSAEOPNOTSUPPOperation not supported.

The Data Connection Could Not Be Established: Wsaeaddrnotavail Cannot Assign Requested Address

The attempted operation is not supported for the referenced object. Typically, this occurs when trying to call a Winsock function on a socket that does not support that operation.

For example, calling accept or WSAAccept on a datagram socket will cause this error.100460017WSAEPFNOSUPPORTProtocol family not supported. The requested protocol family does not exist or is not installed on the system. In most cases, this error is interchangeable with WSAEAFNOSUPPORT, which occurs more often.100470017WSAEAFNOSUPPORTAddress family does not support requested operation. This error occurs when attempting to perform an operation that is not supported by the socket type.

For example, trying to call sendto or WSASendTo with a socket of type SOCKSTREAM will generate this error. This error can also occur when calling socket or WSASocket and requesting an invalid combination of address family, socket type, and protocol.100480017WSAEADDRINUSEAddress already in use. Under normal circumstances, only one socket is permitted to use each socket address. (For example, an IP socket address consists of the local IP address and port number.) This error is usually associated with the bind, connect, and WSAConnect functions. The socket option SOREUSEADDR can be set with the setsockopt function to allow multiple sockets access to the same local IP address and port. (For more information, see Chapter 9.)100490017WSAEADDRNOTAVAILCannot assign requested address. This error occurs when the address specified in an API call is not valid for that function.

The data connection could not be established wsaeaddrnotavail - cannot assign requested address

For example, specifying an IP address in bind that does not correspond to a local IP interface will generate this error. This error also can occur when specifying port 0 for the remote machine to connect to with connect, WSAConnect, sendto, WSASendTo, and WSAJoinLeaf.100500017WSAENETDOWNNetwork is down. The operation encountered a dead network. This could indicate the failure of the network stack, the network interface, or the local network.100510017WSAENETUNREACHNetwork is unreachable. An operation was attempted to an unreachable network.

This indicates that the local host does not know how to reach the remote host0017in other words, no known route to the destination exists.100520017WSAENETRESETNetwork dropped the connection on reset. The connection has been broken because keepalives have detected a failure. This error can also occur when attempting to set the SOKEEPALIVE option with setsockopt on a connection that has already failed.100530017WSAECONNABORTEDSoftware caused the connection to abort. An established connection was aborted due to a software error.

Typically, this means the connection was aborted due to a protocol or timeout error.100540017WSAECONNRESETConnection reset by peer. An established connection was forcibly closed by the remote host. This error can occur if the remote process is abnormally terminated (as in memory violation or hardware failure) or if a hard close was performed on the socket. A socket can be configured for a hard close using the SOLINGER socket option and setsockopt.

(For more information, see Chapter 9.)100550017WSAENOBUFSNo buffer space available. The requested operation could not be performed because the system lacked sufficient buffer space.100560017WSAEISCONNSocket is already connected. A connection is being attempted on a socket that is already connected. This can occur on both datagram and stream sockets. When using datagram sockets, if connect or WSAConnect has been called to associate an endpoint's address for datagram communication, attempting to call either sendto or WSASendTo will generate this error.100570017WSAENOTCONNSocket is not connected.

This error occurs when a request is made to send or receive data on a connection-oriented socket that is not currently connected.100580017WSAESHUTDOWNCannot send after socket shutdown. The socket has already been partially closed by a call to shutdown, and either a send or a receive operation is being requested. Note that this occurs only on the data-flow direction that has been shut down. For example, after calling shutdown on sends, any call to send data will generate this error.100600017WSAETIMEDOUTConnection timed out.

This error occurs when a connection request has been made and the remote computer fails to properly respond (or doesn't respond at all) after a specified length of time. This error is typically seen when the socket options SOSNDTIMEO and SORCVTIMEO are set on a socket as well as when the connect and WSAConnect functions are called. For more information on setting SOSNDTIMEO and SORCVTIMEO on a socket, see Chapter 9.100610017WSAECONNREFUSEDConnection refused. The connection could not be established because the target machine refused it. This error usually occurs because no application on the remote machine is servicing connections on that address.100640017WSAEHOSTDOWNHost is down. This error indicates that the operation has failed because the destination host is down; however, an application is more likely to receive the error═WSAETIMEDOUT because it typically occurs when attempting to establish a connection.100650017WSAEHOSTUNREACHNo route to host.

An operation was attempted to an unreachable host. This error is similar to WSAENETUNREACH.100670017WSAEPROCLIMToo many processes. Some Winsock service providers set a limit on the number of processes that can simultaneously access them.100910017WSASYSNOTREADYNetwork subsystem is unavailable.

This error is returned when calling WSAStartup, and the provider cannot function because the underlying system that provides services is unavailable.100920017WSAVERNOTSUPPORTEDWinsock.dll version out of range. The requested version of the Winsock provider is not supported.100930017WSANOTINITIALISEDWinsock has not been initialized. A successful call to WSAStartup has not yet been performed.101010017WSAEDISCONGraceful shutdown in progress. This error is returned by WSARecv and WSARecvFrom to indicate that the remote party has initiated a graceful shutdown. This error occurs on message-oriented protocols such as ATM.101020017WSAENOMORENo more records found. This error is returned from WSALookupServiceNext to indicate that no additional records are left. This error is interchangeable with WSAENOMORE.

Applications should check for both this error and WSAENOMORE.101030017WSAECANCELLEDOperation canceled. This error indicates that a call to WSALookupServiceEnd was made while a call to WSALookupServiceNext was still processing. WSALookupServiceNext returns this error.

The Data Connection Could Not Be Established Wsaeaddrnotavail - Cannot Assign Requested Address

This code is interchangeable with WSAECANCELLED. Applications should check for both this error and WSAECANCELLED.101040017WSAEINVALIDPROCTABLEThe procedure call table is invalid. This error is typically returned by a service provider when the procedure table contains invalid entries. For more information on service providers, see Chapter 17WSAEINVALIDPROVIDERInvalid service provider. This error is associated with service providers and occurs when the provider cannot establish the correct Winsock version needed to function correctly.101060017WSAEPROVIDERFAILEDIN ITThe provider failed to initialize. This error is associated with service providers and is typically seen when the provider cannot load the necessary DLLs.101070017WSASYSCALLFAILURESystem call failure. A system call that should never fail has failed.101080017WSASERVICENOTFOUNDNo such service found.

This error is normally associated with registration and name resolution functions when querying for services. (See Chapter 10 for more information about these functions.) This error indicates that the requested service could not be found in the given name space.101090017WSATYPENOTFOUNDClass type not found. This error is also associated with the registration and name resolution functions when manipulating service classes. When an instance of a service is registered, it must reference a service class that was previously installed with WSAInstallServiceClass.101100017WSAENOMORENo more records found. This error is returned from WSALookupServiceNext to indicate that no additional records are left. It is interchangeable with WSAENOMORE. Applications should check for both this error and WSAENOMORE.101110017WSAECANCELLEDOperation canceled.

This error indicates that a call to WSALookupServiceEnd was made while a call to WSALookupServiceNext was still processing. WSALookupServiceNext returns this error. This code is interchangeable with WSAECANCELLED. Applications should check for both this error and WSAECANCELLED.101120017WSAEREFUSEDQuery refused. A database query failed because it was actively refused.110010017WSAHOSTNOTFOUNDHost not found.

Connection

This error occurs with gethostbyname and gethostbyaddr to indicate that an authoritative answer host was not found.110020017WSATRYAGAINNonauthoritative host not found. This error is also associated with gethostbyname and gethostbyaddr, and it indicates that either the nonauthoritative host was not found or a server failure occurred.110030017WSANORECOVERYA nonrecoverable error occurred. This error is also associated with gethostbyname and gethostbyaddr. It indicates that a nonrecoverable error has occurred and the operation should be tried again.110040017WSANODATANo data record of the requested type found. This error is also associated with gethostbyname and gethostbyaddr. It indicates that the supplied name was valid but that no data record of the requested type was found with it.110050017WSAQOSRECEIVERSAt least one reserve message has arrived. This value is associated with IP Quality of Service (QOS) and is not an error per se.

(See Chapter 12 for more on QOS.) It indicates that at least one process on the network is interested in receiving QOS traffic.110060017WSAQOSSENDERSAt least one path message has arrived. This value is associated with QOS and is more of a status message. This value indicates that at least one process on the network is interested in sending QOS traffic.110070017WSAQOSNOSENDERSNo QOS senders. This value is associated with QOS and indicates that there are no longer any processes interested in sending QOS data. See Chapter 12 for a more complete description of when this error occurs.110080017WSAQOSNORECEIVERSNo QOS receivers.

This value is associated with QOS and indicates that there are no longer any processes interested in receiving QOS data. See Chapter 12 for a more complete description of this error.110090017WSAQOSREQUESTCONF IRMEDReservation request has been confirmed. QOS applications can request that they be notified when their reservation request for network bandwidth has been approved. When such a request is made, this is the message generated. See Chapter 12 for a more complete description.110100017WSAQOSADMISSIONFA ILUREError due to lack of resources.

Insufficient resources were available to satisfy the QOS bandwidth request.110110017WSAQOSPOLICYFAILU REInvalid credentials. Either the user did not possess the correct privileges or the supplied credentials were invalid when making a QOS reservation request.110120017WSAQOSBADSTYLEUnknown or conflicting style. QOS applications can establish different filter styles for a given session.

This error indicates either unknown or conflicting style types. See Chapter 12 for a description of filter styles.110130017WSAQOSBADOBJECTInvalid FILTERSPEC structure or provider-specific object. This error occurs if either the FLOWSPEC structures or the provider-specific buffers of a QOS object are invalid. See Chapter 12 for more details.110140017WSAQOSTRAFFICCTRL ERRORProblem with a FLOWSPEC. This error occurs if the traffic control component has a problem with the supplied FLOWSPEC parameters that are passed as a member of a QOS object.110150017WSAQOSGENERICERRO RGeneral QOS error. This is a catchall error that is returned when the other QOS errors do not apply.60017WSAINVALIDHANDLESpecified event object invalid. This Win32 error is seen when using Winsock functions that map to Win32 functions.

This particular error occurs when a handle passed to WSAWaitForMultipleEvents is invalid.80017WSANOTENOUGHMEMORYInsufficient memory available. This Win32 error indicates that insufficient memory is available to complete the operation.870017WSAINVALIDPARAMETEROne or more parameters are invalid. This Win32 error indicates that a parameter passed into the function is invalid. This error also occurs with WSAWaitForMultipleEvents when the event count parameter is not valid.2580017WSAWAITTIMEOUTOperation timed out. This Win32 error indicates that the overlapped operation did not complete in the specified time.9950017WSAOPERATIONABORTEDOverlapped operation aborted.

This Win32 error indicates that an overlapped I/O operation was canceled because of the closure of a socket. In addition, this error can occur when executing the SIOFLUSH ioctl command.9960017WSAIOINCOMPLETEOverlapped I/O event object is not in a signaled state. This Win32 error is also associated with overlapped I/O.

It is seen when calling WSAGetOverlappedResults and indicates that the overlapped I/O operation has not yet completed.9970017WSAIOPENDINGOverlapped operations will complete later. When making an overlapped I/O call with a Winsock function, this Win32 error is returned to indicate that the operation is pending and will complete later. See Chapter 8 for a discussion of overlapped I/O.