Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help3002


This forum is provided to promote discussion amongst students enrolled in Computer Networks (CITS3002).
 
Before posting a question here, you may like to read the article How To Ask Questions The Smart Way.
 
Options:
RSS cloud
Jump to:

When is the file descriptors in Select() 'ready'?

5 of 768 articles shown, currently no other people reading this forum.
photo
From: ANONYMOUS
Date: Thu 4th Jun, 4:34pm
Summary: hot
Actions: 
        Login-to-reply

 

Hi,

I'm having an issue with the select() function since it doesn't block when called. 
The way I understand select() is when called and one of the file descriptors is 
'ready' like an incoming tcp request, then it should unblock. When I call select(), 
my file descriptors seem to be always ready. I'm not sure how to resolve this since I 
don't know what the function is doing to determine a file descriptor is ready or not. 

Another question is with the assignment, if you got the extension to the 2nd of June, 
does the 5% each day reduction in mark start from that day?

Thanks.

When is the file descriptors in Select() 'ready'?

photo
From: Kirra F.
Date: Thu 4th Jun, 5:39pm
Actions: 
        Login-to-reply

 

Not sure why, but running my program a few times resolved the issue. I didn't change my 
code but the select() is now blocking.

When is the file descriptors in Select() 'ready'?

photo
From: Christopher M.
Date: Thu 4th Jun, 5:58pm
Actions: 
        Login-to-reply

 

"Kirra Fisher" <22*4*2*[email protected]*u*e*t*u*a*e*u*a*> wrote:

> Not sure why, but running my program a few times resolved the issue. I didn't change my 
> code but the select() is now blocking.

No changes to the code, and it starts working?
I guess you're starting to believe in good fairies about now :-)

When is the file descriptors in Select() 'ready'?

photo
From: Edward A.
Date: Fri 5th Jun, 2:55pm
Actions: 
        Login-to-reply

 

One thing I found the hard way with select was that if you set your writable or error-able file descriptors to anything but NULL or your language equivalent you'll burn your CPU up really fast as every file descriptor will be arbitrarily writable on each loop. 

When is the file descriptors in Select() 'ready'?

photo
From: Christopher M.
Date: Sat 6th Jun, 8:38am
Actions: 
        Login-to-reply

 

No surprises there ^^.

A NULL pointer indicates to select() that you're not interested in writable descriptors, etc.
Providing a non-NULL pointer says "the array or file descriptors I AM interested in starts here...."
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  5:31am Aug 04 2020