msmq stackoverflow exception
-
I am writeing windows service that makes use of MSMQ in .net 2003 in c#. I use the method beginPeek(TimeSpan) and wating for an message to arrive the event handler look like this: private void MyPeekCompleted(Object source, PeekCompletedEventArgs asyncResult) { try { // End the asynchronous peek operation. Message m = _mq.EndPeek(asyncResult.AsyncResult); //logic to handel message mq.BeginPeek(new TimeSpan(0,1,0)); } catch(MessageQueueException e) { if (e.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout) { Console.WriteLine(e.ToString()); } _mq.BeginPeek(new TimeSpan(0,1,0)); } catch(Exception ex) { // some code to handel error } after a while i get stackoverflow exception. event though no messages arrives... It works fike for a couple of minuts and than crushes.. How can i solve this.. Sample code will be greate help.. im using winXP Thnks