question abt select() on FC 3
Hi
I m having problem with the select call in my program. IF i pass it FD_SETSIZE as first argument select (FD_SETSIZE, &readfs, NULL, NULL, NULL)it works fine but if i change it to something like int fds= 4; select (FD_SETSIZE, &readfs, NULL, NULL, NULL); it never returns. there is no error or anything. btw i m using Linux FC 3 with gcc gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) any idea? |
select (FD_SETSIZE, &readfs, NULL, NULL, NULL) with this argument set you are passing NULL as the last argument which is a timeout. And if you set this to NULL the select call will block just like a recv or accept call. If this is not what you want and you want select to return after a timeout then you will too create a timeval struct for the last argument with a timeout before each call to select (since select sets it to zero when it returns).
|
my question was i about first argument FD_SETSIZE.
if i keep it to FD_SETSIZE my program would work OK but if i change it to something like 2 or some userdefined value it never comes back frm select() (in both cases the last argument is NULL) |
So you are saying if you call select in the following way.
int fds= 4; select (fds, &readfs, NULL, NULL, NULL); It will never return. How many FDs have you put into readfs? |
All times are GMT -5. The time now is 10:15 AM. |