Hi,
I am using select() call under HP-UX 10.20 for timing on socket. It throws
the error EBADF. I don't understand why it happens.
The socket is opened successfully before calling the select and the
descriptor is valid.

I will give the relevant code below.

    int mask;
    struct fd_set readmask ;
    readmask.fds_bits[0] = 0;
    struct fd_set readfds;
    int nfound, i;
    struct timeval timeout;

    mask = MASK(m_iSocket);
    readmask.fds_bits[0] |= mask;
    readfds.fds_bits[0] = readmask.fds_bits[0];

    timeout.tv_sec  = m_iSelectTimeout;
    timeout.tv_usec = 0;
    FD_ZERO(&readfds);

    if ((nfound = select (SOCKETS, &readfds, 0, 0, &timeout)) == -1)
    {
     cerr << "==>Select call failed : " << endl;
     //Errror checking done
     .......
     ........
    }

Thanks in advance
Regards
Ullasan


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to