M
Marcel Brekelmans
Hi,
I use a socket to receive data from a certain process. I use the
asynchronous operations BeginReceive() and EndReceive(), with a callback in
BeginReceive. Now all documentation says that the callback, as specified in
BeginReceive, is called as soon as 'the data is received'. But this is
rather vague: when exactly is that moment if you don't know how exactly that
other process is providing data?
One criterium is that BeginReceive() is considered completed (and thus the
callbask is called) when the buffer in the state object is filled upto the
specified buffersize. But what if the 'delivering' process is feeding data
in unknown quantities and in an irregular pattern? For instance, if it first
delivers 100 bytes consecutively, and then there is a time interval of 1
millisecond and another 200 bytes follow: does BeginReceive complete with
100 bytes of incoming data? Or 300?
Thanks for any insight.
Marcel Brekelmans
I use a socket to receive data from a certain process. I use the
asynchronous operations BeginReceive() and EndReceive(), with a callback in
BeginReceive. Now all documentation says that the callback, as specified in
BeginReceive, is called as soon as 'the data is received'. But this is
rather vague: when exactly is that moment if you don't know how exactly that
other process is providing data?
One criterium is that BeginReceive() is considered completed (and thus the
callbask is called) when the buffer in the state object is filled upto the
specified buffersize. But what if the 'delivering' process is feeding data
in unknown quantities and in an irregular pattern? For instance, if it first
delivers 100 bytes consecutively, and then there is a time interval of 1
millisecond and another 200 bytes follow: does BeginReceive complete with
100 bytes of incoming data? Or 300?
Thanks for any insight.
Marcel Brekelmans