有些指针,如CSocket my_socket;DA_HANDLE_T m_da_handle_t;如果.close()之类的函数返回失败,则是否一定要继续close,关闭整个应用程序是否可以释放智能指针?谢谢

解决方案 »

  1.   

    我认为没有必要继续调用closesocket。
    closesocket出错有以下原因,一些是给程序员错误使用设置的,还有1.1版本的基本不用了,WSAENETDOWN是驱动程序或硬件故障 :WSANOTINITIALISED A successful WSAStartup must occur before using this function. 
    WSAENETDOWN The network subsystem has failed. 
    WSAENOTSOCK The descriptor is not a socket. 
    WSAEINPROGRESS A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function. 
    WSAEINTR The (blocking) Windows Socket 1.1 call was canceled through WSACancelBlockingCall. 
    WSAEWOULDBLOCK The socket is ed as nonblocking and SO_LINGER is set to a nonzero time-out value.