How does the remote process know and respond to the datas arrival?
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?
[491 byte] By [
forester] at [2007-11-18 20:33:30]

# 3 Re: How does the remote process know and respond to the datas arrival?
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
# 4 Re: How does the remote process know and respond to the datas arrival?
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.
# 5 Re: How does the remote process know and respond to the datas arrival?
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!
# 6 Re: How does the remote process know and respond to the datas arrival?
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.
Bios1 at 2007-11-9 13:51:46 >
