PRB: Connect() Fails, WSAGetLastError() returns WSAENETUNREACH

ID: Q140014


The information in this article applies to:


SYMPTOMS

A Win32 Winsock client issues a connect() call over SPX or SPXII protocols and the call fails with SOCKET_ERROR with WSAGetLastError() returning error WSAENETUNREACH(10051).


CAUSE

Either the IPX network number specified in the SOCKADDR_IPX address structure for the server is incorrect (network unreachable), or the server is not listening on the specified socket number.


STATUS

This behavior is by design.


MORE INFORMATION

If a Win32 Winsock clients issues a connect() call over TCP/IP protocol for a server and the server is not listening on the specified port, connect() returns SOCKET_ERROR and WSAGetLastError() returns error WSAECONNREFUSED(10061). However, the IPX/SPX implementation of Windows sockets on the Windows NT platform returns error WSAENETUNREACH for the same scenario.


Keywords          : kbnetwork kbAPI kbNTOS351 kbSDKPlatform kbWinsock kbGrpNet 
Version           : 
Platform          : 
Issue type        : kbprb 

Last Reviewed: March 6, 1999