LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   select problem (https://www.linuxquestions.org/questions/linux-newbie-8/select-problem-732405/)

Marrti Jokinen 06-12-2009 02:31 AM

select problem
 
Problems with select(..). I testing simple server - client socket connection. Creatin of socket is ok, server goes to accept() and after accept it goes to select(..). When client makes connection server leaves accept with OK status and enters select(..), select() doest returnif even there data coming - return with 0 status after timeout. I tested by adding read() just after select and read was able to get data even the status of select() was 0. Code is like in the simpliest examples. Noffds is fd+1, timeout 5.

Wim Sturkenboom 06-12-2009 04:47 AM

Please post your code (between code tags). At this stage I think that you have not added the correct socket descriptor or that you have made a mistake in the highest number. The correct socket descriptor for the select is the one that is returned by accept (if I recall correctly).

There is a dedicated programming section here at LQ. You can use the 'report' button at the bottom of your post and ask a moderator to move this thread.


All times are GMT -5. The time now is 12:36 PM.