문제

I have this code:

class Connection
{
public:
    boost::asio::ip::tcp::socket socket_;
}

void main()
{
   Connection* session = new Connection();
   //for example
   session->socket_.close() // FATAL ERROR PAGE FAULT
   // How to check whether child member socket_ is null? if(session->socket_ != NULL) - error : no operator != mathes these operands
}

When i try if(session->socket_ != NULL) - error : no operator != mathes these operands

I Use VS2010

Thanks!

도움이 되었습니까?

해결책

socket_ is not a pointer and so no operator is define to compare it against NULL. Maybe you need to use is_open.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top