xmlrpc, httplib and SSL (HTTP 1.1 XMLRPC client)

Roger Binns rogerb at rogerbinns.com
Thu Apr 1 12:13:11 EST 2004


> I wanted to do keep the connections on which my clients do XMLRPC calls
> open, and after staring at the xmlrpclib.py source for a while, came up
> with the class at the bottom of the message.

Are you sure you are actually getting persistent connections?  The
code will auto-close and auto-open the connection even just keeping
the same HTTP connection object.

In order for the connection to not be auto-closed, the remote end
must return a HTTP/1.1 response (see httplib.HTTPResponse._check_close).

If your server end is Python, then it will always close the connection
unless the request was HTTP/1.1 *and* a 'Connection: keep-alive' header
was sent, which the Python client does not do.

The above is all true for Python 2.3.  For 2.2 it does HTTP/1.0 IIRC
so you have no hope.

Roger





More information about the Python-list mailing list