blocking sockets
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > blocking sockets




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    blocking sockets  
j0mbolar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:22 AM

do blocking sockets have an implicit select/poll mechanism?





[ Post a follow-up to this message ]



    Re: blocking sockets  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:22 AM

In article <2d31a9f9.0409200706.289564ef@posting.google.com>,
j0mbolar@engineer.com (j0mbolar) wrote:

> do blocking sockets have an implicit select/poll mechanism?

I guess that's a way to think of it.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: blocking sockets  
manu


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:22 AM

j0mbolar wrote:
> do blocking sockets have an implicit select/poll mechanism?

Nope. It's just the way the sockets are implemented. It's very similar
to pipes. Your read/write system calls block at one end when the other
end is open. As soon as data comes, system call returns. Same thing
happens to sockets. A process which is waiting (sleeping) for data on
one socket is woken up by the kernel as soon as it gets the data for
that socket.

Unlike select/poll, kernel doesn't work on a set of descriptors here.
It just receives the data. This data goes to TCP layer which decides
which process and descriptors should get this data. And then if the
process is waiting to read the data, the read system call returns
otherwise this data is put in the buffer.

I hope this clears your doubt.
Cheers,
-Manu
---------
Manu Garg
http://manugarg.freezope.org






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:47 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register