LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-12-2009, 03:31 AM   #1
Marrti Jokinen
LQ Newbie
 
Registered: Jun 2009
Posts: 12

Rep: Reputation: 0
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.
 
Old 06-12-2009, 05:47 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
socket - select() timeout problem in Linux Tejesh Linux - Networking 2 06-10-2009 05:38 AM
Problem select( ) teqno82 Programming 1 06-02-2006 06:59 AM
problem with select() fnoyan Programming 3 12-21-2005 04:17 PM
Select problem with multiple listeners Fruitbat Programming 3 04-29-2005 01:24 PM
acrobat reader text search and select problem aolq Linux - Software 0 02-17-2004 09:16 PM


All times are GMT -5. The time now is 08:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration