473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Persistent XMLRPC Connection

I noticed the SimpleXMLRPCServer/ServerProxy creates a new socket for
remote procedure call. I've written a simple IP based authentication
scheme for the Server, and I'd like to include the port in the
authentication, which is currently not possible since the port keeps
changing.

I've looked at the code in SimpleXMLRPCServer.py, xmlrpclib.py,
SocketServer.py, and BaseHTTPServer.py, but it's a little overwhelming.
How difficult would it be to reuse connections so that only one port per
persistent client connection is used?

Sincerely,
Chris
Aug 14 '05 #1
1 3294
Hi,

I've made my SimpleXMLRPCServer support persistent connections by subclassing SimpleXMLRPCRequestHandler (see attachment xmlsrv.txt).

Now make sure to use this request handler in your SimpleXMLRPCServer and you're done (for the server).

On the client side you have to implement a Transport instance using such a persistent connection. But that's quite easy too (see attachment xmlcli.txt).

I was wondering why this is missing in python's standard library.

have a nice day,

Johannes Vetter
Attached Files
File Type: txt xmlsrv.txt (5.8 KB, 767 views)
File Type: txt xmlcli.txt (4.7 KB, 653 views)
Aug 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Derek Fountain | last post by:
For a low-ish traffic website that is doing the simple "build pages from HTML templates and info in a database" kind of thing, do the wise folks in this newsgroup advocate connecting and...
6
by: Michael Urman | last post by:
Hi. I'm a user of python for about 3 years now. I've written a client-server application that uses SimpleXMLRPCServer and xmlrpclib.ServerProxy to communicate. It's intended to be used by a...
6
by: David Rasmussen | last post by:
I use urllib2 to do some simple HTTP communication with a web server. In one "session", I do maybe 10-15 requests. It seems that urllib2 opens op a connection every time I do a request. Can I...
3
by: David Hirschfield | last post by:
An xmlrpc client/server app I'm writing used to be super-simple, but now threading has gotten into the mix. On the server side, threads are used to process requests from a queue as they come in....
0
by: xristoph | last post by:
Hello everyone! I am trying to set up a broker-worker system (one broker, multiple and heterogeneous workers) in python for a local network (though possibly also over inet). I am using...
1
by: hide1713 | last post by:
Hi everyone I am working on a system which used XMLRPC to communicate between hundreds of computer. One administrative computer keeps hundreds of xmlrpc instance of other computers. I want to...
0
by: Benjamin Grieshaber | last post by:
Hi, I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10) I tried to compile php with xmlrpc support and got the following errors: ...
9
by: mel | last post by:
Hi all, I need a persistent TCP connection with my web server over page reloads. This means that, even if the user goes to a different page (in my domain), I want to keep a TCP connection...
0
by: Gustavo Rahal | last post by:
Hi I'm trying to build a xmlrpc client that uses a proxy to connect to a xmlrpc server in https. I've googled and came up with a code snippet that doesn't actually work. What is missing?
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.