Calling same function until it connect to server
- by user171523
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.