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

  • SEARCH
  • Home
  • 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 6334715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:42:43+00:00 2026-05-24T18:42:43+00:00

This is the prototype of the select statement (acc to man pages): int select(int

  • 0

This is the prototype of the select statement (acc to man pages):

    int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
           struct timeval *timeout);

I know what to use the readfds parameter for: with this one you can see if data was written to one of your sockets. On the other hand, the writefds page that I found, states that this is to see “if any of the sockets is ready to send() data to”. But what does this mean? In Windows Sockets Network Programming by Quin and Shute it says that this detects either the connected or the writable state. What is the point of this? Is it simply to check whether a socket still has a connection to a connected client and test whether is has any use writing something to that socket?

So: what does one normally use writefds for?

  • 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-05-24T18:42:45+00:00Added an answer on May 24, 2026 at 6:42 pm

    If you keep writing to a TCP socket and the other side doesn’t receive as fast as you send, there comes a time when write blocks. You want to avoid that so you need to test that "you can write without blocking". Because this normally doesn’t happen in test programs, it could come as a shock, but write(2) and send(2) can block.

    So if select(2) says a fd is set in writefds then it means any write or send on it will actually write at least one byte without blocking.

    EDIT

    From the standard:

    The pselect() function shall examine the file descriptor sets whose
    addresses are passed in the readfds, writefds, and errorfds parameters
    to see whether some of their descriptors are ready for reading, are
    ready for writing, or have an exceptional condition pending,
    respectively.

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

Sidebar

Related Questions

The prototype is: int select (int nfds, fd_set *read-fds, fd_set *write-fds, fd_set *except-fds, struct
I have a problem with scandir() : The manpage contains this as prototype: int
Please help to replace these jQuery functions with Prototype ones: $(button,input,label,select,textarea).bind('mouseover mouseout', function(){$(this).toggleClass('hover')}); $(button,input,select,textarea).bind('focus
There is currently this Prototype code that does a PUT: new Ajax.Request(someUrl, { method:
I have the below prog Object.prototype.inherit = function(baseConstructor) { this.prototype = (baseConstructor.prototype); this.prototype.constructor =
I'm using JQuery and Prototype in this web application that I'm developing. I'm looking
I am trying to trigger the onScroll event this way using prototype: Event.observe(document, 'scroll',
This code is from Prototype.js . I've looked at probably 20 different tutorials, and
This is an example code from the prototype site. var url = '/proxy?url=' +
This is a continuation of Confused as to which Prototype helper to use .

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.