无法立即完成一个非阻挡性套接字操作。WSAENOTSOCK 
(10038) 
Socket operation on non-socket. 
An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid. 在WINSOCK2.H 定义了这些错误码,在MSDN上有解释

解决方案 »

  1.   

    使用这段代码,将出错代码转换成语言描述
    LPVOID lpMsgBuf;
    FormatMessage( 
        FORMAT_MESSAGE_ALLOCATE_BUFFER | 
        FORMAT_MESSAGE_FROM_SYSTEM | 
        FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL,
        GetLastError(),
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
        (LPTSTR) &lpMsgBuf,
        0,
        NULL 
    );
    // Process any inserts in lpMsgBuf.
    // ...
    // Display the string.
    AfxMessageBox((LPCTSTR)lpMsgBuf);
    // Free the buffer.
    LocalFree( lpMsgBuf );
      

  2.   

    无法立即完成一个非阻挡性套接字操作。 用Microsoft的工具 error lookup
    Visual Studio里的一个工具,只要输入错误代码
    上面的信息就是他返回的
      

  3.   

    An operation was attempted on something that is not a socket. vc的工具中有一个error lookup的工具,不过你装vc的时候得选tool
      

  4.   

    从error lookup中可以查出:
    此错误代码值所对应的描述字符串为:
    无法立即完成一个非阻挡性套接字操作。