Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9238137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:41:22+00:00 2026-06-18T07:41:22+00:00

As described in network programming books, select() monitors a set of file descriptors for

  • 0

As described in network programming books, select() monitors a set of file descriptors for reading. For example, here is part of code:

select(numfds, &read_fds, NULL, NULL, NULL);

Here numfds is maximum number of socket in read_fds + 1. Does it mean, that every “monitor” cycle select() watchs through all file descriptors of the process from 0 to numfds? I mean, if I have only two file descriptors to monitor(0 and 26), does select watch all descriptors from 0 to 26?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:41:24+00:00Added an answer on June 18, 2026 at 7:41 am

    Every monitor cycle means, whenever the operating system gets around to it essentially, it may choose to periodically check the descriptors or handle it via event or interrupts. When data is received on a socket file descriptor the descriptor file gets populated with data and the process that was waiting on it is informed. This doesn’t always happen immediately as the process isn’t woken immediately it is simply put back on the ready to run queue (since it was blocked by the select call). If the select call happens to fail (no data received in timeout) then a timer fires and puts the process back on the run queue.

    Yes fd’s in the FD_SET 0-26 are checked or monitored. This is just to put an upper bound on the search for file descriptors. IIRC this is because an fd_set type is implemented as a bitset internally since it is easier to specify indexes as this can save space. I may be wrong in the previous statement as I haven’t visited that code in glibc in a while.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As described in Beej's Guide to network Programming , select() monitors a set of
Here is well described how to call member function by pointer: http://www.newty.de/fpt/functor.html But the
The CSS gradient is described here , but I have no idea how to
This is the problem described in Programming pearls . I can not understand binary
Im using this code http://platinumdogs.wordpress.com/2008/10/30/net-c-impersonation-with-network-credentials/#comment-770 to connect from a machine in the domain to
I want to implement a network delay model for TCP/UDP traffic as described in
At my server, we receive Self Described Messages (as defined here ... which btw
I made the chat example that is described on most of the sites (I
I'd like to do some network socket programming in C++ and have found the
I'm working on a multithreaded library which monitors network traffic from winpcap and transforms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.