Click to See Complete Forum and Search --> : How does the remote process know and respond to the data's arrival?
forester
May 28th, 2004, 03:24 AM
I'm very new to socket programme, I don't understand that, how a remote process on other machine can know the arrival of the data sent by the other process with send(), and respond with using the recv() to get the data in the buffer, is it informed by the Windows system with a notification that "Some data has arrived, please receive it", then the remote process use recv() to fetch the data. that is, the function of recv() will be activated.
Is what I say right or wrong?
forester
May 31st, 2004, 05:06 AM
ANY help will be appreciated!
Andreas Masur
May 31st, 2004, 05:38 AM
[Moved thread]
kuphryn
May 31st, 2004, 12:48 PM
Under a block I/O model, a process has to monitor the I/O buffer. Under a non-blocking I/O model, the OS updates the process.
Kuphryn
Mathew Joy
June 1st, 2004, 02:10 AM
Originally posted by forester
...is it informed by the Windows system with a notification that "Some data has arrived, please receive it", then the remote process use recv() to fetch the data... Well, this kind of notification is there (Both in MFC and api). But this kind of a notifictaion is inefficient and doesn't scale well. The data is for you anyway. So why don't you recv it as soon as possible? recv basically allows you to wait till the data has arrived. You can wait there itself (where you issue a recv) or later somewhere. This is the blocking and non-blocking model Kuphryn was talking about. Chosing between the blocking and the non-blocking IO depends on the load your server has to handle. Overlapped IO (one of the non-blocking model) scales well and is very efficient, but the design complexity is greater than than the simple blocking calls.
forester
June 3rd, 2004, 04:18 AM
Originally posted by kuphryn
Under a block I/O model, a process has to monitor the I/O buffer.
Would you please tell me how to implement the work of monitoring the I/O buffer and what functions will be called to do so? or give me some sample code?
Thanks!
Bios1
June 3rd, 2004, 07:59 PM
It should be treated as an input text in a box: first check if the input is in the right format, then scan the text for key words and make the decision of your program's reaction.
If it's a DCOM or RPC program, it should be more complex, where I'm not sure.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.