1

What will happen if I call the BeginReceive() method twice (one after the other)?

Example:

MessageQueue mq = new MessageQueue("strQueueConnectionhere");
mq.BeginReceive(); // first call
mq.BeginReceive(); // second call

Pls help

thnx :D

Jehof
  • 34,674
  • 10
  • 123
  • 155
Bogs
  • 15
  • 7

1 Answers1

0

You'll have two asynchronise 'BeginReceive' calls waiting for a message to go onto the queue. I'm guessing that when a message pops on, then one of those will handle it and will finish with the ReceiveCompleted event while the other one waits for the next message. If you don't handle the ReceiveCompleted event, then you won't see anything happen.

alexD
  • 2,368
  • 2
  • 32
  • 43