Calling same function until it connect to server

Posted by user171523 on Stack Overflow See other posts from Stack Overflow or by user171523
Published on 2010-04-18T17:07:05Z Indexed on 2010/04/18 17:13 UTC
Read the original article Hit count: 285

Filed under:
|
|

I am in the process of designing a system where i need to keep on trying to connect to MQ server unitl i get a connection.

By default if the MQ is not availlble it will thorugh exception. How can call the same method again and again until i get the connection. I know i can use recursion, is there any better way to do it . Becuase i would like to avoid infinite loops. I also want to wait the the furthere processing until i get connection.

I am using .net 2.0 with C#. It is window Service application.

© Stack Overflow or respective owner

Related posts about c#

Related posts about exception-handling