Asynchronous Socket

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.
 
P

Peter Duniho

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top