vs_integration/src/SocketConnection.cpp
//------------------------------------------------------------------------------
// This function will check if data available in the selected socket
//------------------------------------------------------------------------------
This function will check if data available in the selected socket
This function will check if data available in the selected socket
bool SocketConnection::CheckSocket(int socket) {
    timeval timeout;
    timeout.tv_sec  = 0;
    timeout.tv_usec = 0;
    fd_set sock_set;
    int    nfsd = 0;
    FD_ZERO(&sock_set);
    FD_SET(socket, &sock_set);
    if(select(nfsd,&sock_set,NULL,NULL,&timeout)>0) {
        return true;
    }
    return false;
}
bool SocketConnection :: CheckSocket ( int socket ) { timeval timeout ; timeout . tv_sec = 0 ; timeout . tv_usec = 0 ; fd_set sock_set ; int nfsd = 0 ; FD_ZERO ( & sock_set ) ; FD_SET ( socket , & sock_set ) ; if ( select ( nfsd , & sock_set , NULL , NULL , & timeout ) > 0 ) { return true ; } return false ; }
This function will check if data available in the selected socket
This function will check if data available in the selected socket