MSMQ Async Bug?
Posted on 2004-07-31
I have an application that is using MSMQ.
I have written an event handler to handle async message receiving.
it looks something like this :
Private Sub handler(ByVal objt00 As Object, ByVal objt01 As ReceiveCompletedEventArgs)
' SHOULD BE TRUE IF THERE IS A MESSAGE, FALSE IF TIMEOUT EXPIRED
If objt01.AsyncResult.IsCompleted Then
' process message
' look to see if shutdown waithandle has occured
' if not, resume listening with BeginReceive(TimeSpan)
I initially call BeginReceive(TimeSpan) in a different function
The problem I have is that even if the timeout expires the AsyncResult.IsCompleted flag is true - and there are no messages to process
Has anyone else had this problem or know what I'm doing wrong?