LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-01-2004, 03:39 AM   #1
jhon
Member
 
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
select


Hi,

some conversion problems..

I used select() under WINDOWS and it worked just fine:

Total = select(0, &Reader, &Writer, NLL, NULL);

now, I tried to convert my application into UNIX, and noticed the server get stack under this line.

I though maybe it's because of the first parameter?

should it be numOfActiveSockets +1?

thankx
 
Old 09-01-2004, 03:43 AM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 58
Read 'man select'...here's an excerpt:
Quote:
int select(int n, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);

n is the highest-numbered descriptor in any of the three
sets, plus 1.
 
Old 09-01-2004, 03:45 AM   #3
Stor_G
Member
 
Registered: Aug 2004
Posts: 50

Rep: Reputation: 15
in select under linux, the man says that the first parameter has to be the biggest File Descriptor you wait on + 1
meaning:
if you have 3 file descriptors lets say they have the integer values of 3 4 6.
then you need to set the parameter to 7 which is 6 + 1.
 
Old 09-01-2004, 11:07 AM   #4
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Also check "man select_tut".
 
Old 11-01-2005, 09:37 PM   #5
xucaen
Member
 
Registered: Feb 2004
Distribution: fedora 10
Posts: 73

Rep: Reputation: 15
Quote:
Originally posted by Hko
Also check "man select_tut".
Hi, I am running Debian linux. I don't have select_tut nor any other sockets man pages installed. I don't how this happened. Does anyone know what package they belong to?

Thanks!

Jim
 
Old 11-01-2005, 09:46 PM   #6
xucaen
Member
 
Registered: Feb 2004
Distribution: fedora 10
Posts: 73

Rep: Reputation: 15
Never mind.

apt-get install manpages-dev



Jim

Quote:
Originally posted by xucaen
Hi, I am running Debian linux. I don't have select_tut nor any other sockets man pages installed. I don't how this happened. Does anyone know what package they belong to?

Thanks!

Jim
 
  


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
Select() did not select my socket thvo Programming 1 05-08-2005 12:20 AM
Mysql SELECT WHERE LIKE ivanatora Linux - Software 3 03-20-2005 11:43 AM
SELECT and INNER JOIN Gerardoj Programming 1 06-07-2004 03:09 PM
Pthread VS select kris273 Programming 1 04-06-2004 05:22 PM
what os to select kevinasr Linux - Newbie 2 05-18-2003 06:52 AM


All times are GMT -5. The time now is 09:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration