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

Last reviewed: November 29, 1995
Article ID: Q140014
The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK) version 3.51

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.


Additional reference words: 3.51
KBCategory: kbprg kbnetwork kbprb
KBSubcategory: NtwkWinsock


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.