开发者

MessageQueue BeginReceive() method called twice

开发者 https://www.devze.com 2023-03-11 20:20 出处:网络
What will happen if I call the BeginReceive() method twice (one after the other)? Example: MessageQueue mq = new MessageQueue(\"strQueueConnectionhere\");

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

t开发者_如何学Pythonhnx :D


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消