Asynchronous Socket

  • Thread starter Thread starter ckkwan
  • Start date Start date
C

ckkwan

Can I BeginSend and BeginReceive at the same time?

That means I call BeginSend() without waiting for the callback and
immediately call BeginReceive().

TIA.
 
Can I BeginSend and BeginReceive at the same time?

That means I call BeginSend() without waiting for the callback and
immediately call BeginReceive().

Yes, you can. You can even call them multiple times if you like (in the
case of receives, the buffers should receive data according to the order
in which you called BeginReceive() for each buffer, though you may or may
not receive notification of the completion in that order). I don't
recommend the latter technique for non-experts (the code to manage things
can get complicated), but it can be useful for ensuring best throughput in
certain situations.

Pete
 
Back
Top