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

SimpleXMLRPCServer and socket

P: n/a
Hi,

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 ,
SimpleXMLRPCServer.SimpleXMLRPCServer):

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
and 1 ESTABLISHED).

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...
Juju
Sep 25 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.