xmlrpclib, testing server presence

R

rocco.rossi

I'm employing xmlrpclib for a project at work, and I must say that I'm
quite impressed with its effectiveness and ease of use.

However, I was recently doing some tests when I realized that if the
server was down, the client quite simply hanged (no use of "try ...
except" here) with no error or tracebacks or exceptions whatsoever.

Is there some way in Python of "testing" the presence of the server on
the other end, so as to avoid this situation?

Thank you.
 
T

Trevor Hennion

I'm employing xmlrpclib for a project at work, and I must say that I'm
quite impressed with its effectiveness and ease of use.

However, I was recently doing some tests when I realized that if the
server was down, the client quite simply hanged (no use of "try ...
except" here) with no error or tracebacks or exceptions whatsoever.

Is there some way in Python of "testing" the presence of the server on
the other end, so as to avoid this situation?

Thank you.

Hi,

Could you test for a socket timeout?:

socket.setdefaulttimeout(20.0) # timeout = 20.0 secs

regards

Trevor
http://www.infocentrality.co.uk
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top