Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unix network programming!

Status
Not open for further replies.

aboujouj83

IS-IT--Management
May 9, 2003
52
US
I am reading unix netwrok programming volume 1 by stevens. It's a known book for network programming. If anyone has this book, I would really appreciate any explanation about the use of the "allset" file descriptor on page 165 figure 6.21.
Thanks
Aboujouj
 
The allset variable appears to be the entire set of descriptors. I will need to study this further, but
the loop on the next page appears to copy allset to
rset, check which of the descriptors on rset may be
ready, and then proceed to open and close descriptors
in allset based on their status, data ready, etc.
The Select() function is only called on rset after it
becomes the current descriptor set through the assignment
rset=allset;
Perhaps this separates maintenance from operations.
Dick S.
 
Thanks! I am waiting for more clarification though.
Aboujouj
 
If you had read the manual page for select(), you will have seen
"On exit, the sets are modified in place to indicate which descriptors actually changed status."

So allset is simply a copy of all the file descriptors which you're interested in. More importantly, it is not modified by calling select().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top