Server Side Time Out in c#

J

Jared

Hi

I have an ASP.NET site that uses web services for security. I have two
servers running the same service. Provided the servers are running I am
able to run a check script and swap servers depending on whether the
service is running properly. This works fine if just IIS has fallen
over.

The problem is that if the server is switched off, the ASP.NET code
continues to search for the server and leaves the application hanging.

Is is possible to add a timeout to the server-side code, so that after
say 5 seconds it stops searching for the server and uses the
alternative one?

Thanks

Jared
 
J

Jared

I found a way to get round this. The web service has a Timeout already,
you just need to set it. I am not sure if every type of object has a
Timeout setting.

e.g.
WebService1.Security entsec = new WebService1.Security();

entsec.Timeput = 1000;
string entsecCheck = entsec.CommsCheck([password]);

This will time out after 1 second if the server is turned off.

Jared
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top