469,568 Members | 1,506 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

SimpleXMLRPCServer and socket


First, sorry for my poor English !

I used the SimpleXMLRPCServer facility of Python to develop a
multithread-server, here's part of my code :
class TotoSimpleXMLRPCServer(SocketServer.ThreadingMixIn ,

def __init__(self, addr):
SimpleXMLRPCServer.SimpleXMLRPCServer.__init__(sel f, addr,
SimpleXMLRPCServer.SimpleXMLRPCRequestHandler, 0)

def _dispatch(self, method, params):
if method == "toto58":

The problem I have, is I don't know how to get the port used by the
remote host ?

I tried to get this information with the socket object of the Server,
but this socket always correspond to the LISTENING socket and not the
ESTABLISHED one ! (With the lsof command, I see 2 connexions 1 LISTEN

So, when I tried to getpeername() on this object, I've an Exception
(107, 'Transport endpoint is not connected'), which is normal for a
listening connexion.

How can I get the socket object corresponding to the ESTABLISHED
connexion ? (Or how can I do to get the port of the remote host ?)

Thanks in advance...
Sep 25 '06 #1
0 1094

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.