GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Aug-2005, 05:59
Kjeksen Kjeksen is offline
Junior Member
 
Join Date: May 2005
Posts: 57
Kjeksen is on a distinguished road

Basic understanding on winsock select()


Hey! I im pretty new in winsock. And i want to learn more about it and its functions. So I will ask some questions about different matters in select so i can understand it. Beej`s tutorial doesnt have so good explenations about it.

What about this one.
CPP / C++ / C Code:
if(select(fdmax+1, &read_fds, NULL, NULL, NULL) == -1) {
                        cerr << "Error in select()";
                        cin.get();
                        exit(1);
                        }

Can someone give me a basic explenation on this one? why are there NULL, NULL and NULL?
  #2  
Old 30-Aug-2005, 07:42
L7Sqr L7Sqr is offline
Member
 
Join Date: Jul 2005
Location: constant limbo
Posts: 119
L7Sqr has a spectacular aura about
select watches for status changes on the file descriptors designated by the second,third and fourth fields of the call.
The fields represent (..., read_fd, write_fd, exectption_fd,...)
Passing NULL to any of these fields says that you do not care what happens there. In your case - `I'm not interested in my file descriptors changing status for writing or execption purposes, only for read changes`.
The final field represents a timeout option. If passed NULL, it means you want to have a blocking call (it wont return until something happens).
Google man select for the manual pages detailing the call's specifics.
 
 

Recent GIDBlogMeeting the local Iraqis by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[PROGRAM] Winsock Programming Max Payne MS Visual C++ / MFC Forum 1 08-Mar-2007 23:38
MSDN's Great Contribution To Understanding Dial Up Networking... mithunjacob Open Discussion Forum 2 25-Jun-2004 05:36
select problem zuzupus MySQL / PHP Forum 0 15-Aug-2003 07:25
combo box select problem zuzupus MySQL / PHP Forum 2 23-Jul-2003 11:25

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 11:45.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.