tags:

views:

62

answers:

1

If a queue is empty and you don't want to block for too long, you risk getting a System.Messaging.MessageQueueException.

How would you tell the difference between a timeout on waiting for a message and a real error?

+1  A: 

Try this:

MessageQueueException.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout

See http://msdn.microsoft.com/en-us/library/t5te2tk0.aspx for a sample similar to what you're trying to do.

Justin Grant
Thanks, I can't believe I overlooked that property.
Jonathan Allen