I have a C# server and a C# client using SignalR to communicate. Both are WPF applications. On my client I have a button for logging in at the server. I want to disable the login button if the server is not available.
Is there any way I can check if the server is available or not?
I solved the problem using a thread where I'm trying to connect to the server in an endlees loop. If I get an exception I know the server is not available and after some seconds I try it again. I'm raising events when the connection to the server was possible or not. Works like a charm since one year.