10051 A socket operation was attempted to an unreachable network. 
10061 No connection could be made because the target machine actively refused it. 
 可以通过 error lookup 工具查出错原因 ,也可以通过API FormatMessage得到

解决方案 »

  1.   

    WSAENETUNREACH 
    (10051) 
    Network is unreachable. 
    A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host. WSAECONNREFUSED 
    (10061) 
    Connection refused. 
    No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host - i.e. one with no server application running. 多利用MSDN嘛