LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 02: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, 04:47 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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



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 04:38 AM
Problem select( ) teqno82 Programming 1 06-02-2006 05:59 AM
problem with select() fnoyan Programming 3 12-21-2005 03:17 PM
Select problem with multiple listeners Fruitbat Programming 3 04-29-2005 12:24 PM
acrobat reader text search and select problem aolq Linux - Software 0 02-17-2004 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:28 AM.

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
Open Source Consulting | Domain Registration