> David Schwartz wrote:
> >>    /* This is just one of the tests I have tried */
> >>          FD_ZERO(&rfds);
> >>          FD_SET(acceptSock, &rfds);
> >>          FD_ZERO(&wfds);
> >>          FD_SET(acceptSock, &wfds);
> >>          FD_ZERO(&rfds);
> >>          FD_SET(acceptSock, &efds);
> >>          do {
> >>            /* see if we have any activity on the socket */
> >>                  waitVal = select(acceptSock, &rfds, &wfds,
> &efds, &tv);
> >
> > What happens when you pass 'select' fd sets that make sense and set the
> > first parameter appropriately?

> Dave,
>   I appreciate you taking the time to respond, but I do not follow what
> your saying. If I thought what I was doing wasn't sane I wouldn't do it.
>   So I'm not sure how to make the code 'sane'?

Since you aren't waiting for any exceptional events, you shouldn't be
passing anything as an exception set. Since this is an accepting socket,
writability doesn't apply.

> My original code was just one fd_set for the read case and I passed NULL
> for the write and except parameters, but I had the same problem so I
> added the write and except cases as a test. Since this is an accept call
> that I am trying to make I would expect that all I need is the read
> option but since it didn't work I tried something else.

When you try something that's like a wild guess at what might possibly be
the issue, you need to *undo* it when it doesn't fix anything. Otherwise
you'll wind up with eight things broken rather than one. Most likely your
whole problem was passing the wrong first number to 'select'.

The first number is the size of the fd sets. If you're interested in file
descriptor 9, you need an fd set of size 10 (slots for fds 0, 1, 2, 3, 4, 5,
6, 7, 8, and 9). So you need to add one to 'acceptSock'.

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to