MSMQ:以非阻塞方式读取队列的最佳方法是什么?

时间:2009-11-03 22:25:55

标签: msmq

如果队列为空并且您不想阻塞太长时间,则可能会出现System.Messaging.MessageQueueException。

您如何判断等待消息的超时与实际错误之间的区别?

1 个答案:

答案 0 :(得分:2)

试试这个:

MessageQueueException.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout

请参阅http://msdn.microsoft.com/en-us/library/t5te2tk0.aspx,了解与您尝试的相似的示例。

相关问题