By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,246 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,246 IT Pros & Developers. It's quick & easy.

xmlrpclib, testing server presence

P: n/a
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.
Feb 2 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sat, 02 Feb 2008 00:22:15 -0800, rocco.rossi wrote:
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
Feb 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.