473,320 Members | 1,838 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.

SimpleXMLRPCServer and client IP address

Hello,

I've started python a few weeks ago, and to now everything went fine
with my cookbook and a learning book.

Now, I've tried the SimpleXMLRPCServer, and it worked OK untill I
tried to get the client IP address. I have searched a long time the
Internet but couldn't find a _simple_ solution :-)

#Code

from liste_films import *
import SimpleXMLRPCServer

def isOpen():
# Here I want to get the clien IP address
if CheckPerms(IP):
return True
else:
return False

if __name__ == '__main__':
server = SimpleXMLRPCServer.SimpleXMLRPCServer(("localhost" , 8000))
server.register_function(isOpen)
server.serve_forever()

#end code

Tips I've found were :
- inherit from requestDispatcher and overload its methods. But that's
not that Simple.
- use the requestHandler and its method address_string(), but I didn't
an easy to understand example
- http://mail.python.org/pipermail/pyt...ay/340266.html
but this thread seems not to have been finished :-(

Furthermore, I think I should be able to access the socket object from
where I am (at starting of isOpen() ), but I don't know how. "self"
and "parent" are not defined, I can access the "server" object, but it
says the other end s not connected ("transport endpoint"). I think
this SimpleXMLRPCServer was not threaded (because it says in the API :
"answer all requests one at a time"), so I don't understand why in the
middle of my function the server.socket.getpeername() says it's not
connected.

I'm using python2.3 on linux (debian sid).

Thanks for any help !

Jeremy
--
Linux Registered User #317862
Linux From Scratch Registered User #16571
Please do not send me .doc, .xls, .ppt, as I will *NOT* read them.
Please send me only open formats, as OpenDocument or pdf.
Jun 28 '06 #1
0 1613

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

Similar topics

9
by: Yannick Turgeon | last post by:
I plan to use XML-RPC to communicate between my python server and VB client. I just called a simple registered function (lambda x,y: x+y) and it worked. But I'm new to XML-RPC and I'm now wondering...
4
by: codecraig | last post by:
Hi, I thought I posted this, but its been about 10min and hasnt shown up on the group. Basically I created a SimpleXMLRPCServer and when one of its methods gets called and it returns a response...
3
by: Daniel Crespo | last post by:
Hello, Does anyone know which methods do I have to override for allowing Nones to be accepted and sended from SimpleXMLRPCServer to the client? Thanks Daniel
4
by: stuff | last post by:
Is it possible to obtain the client's ip address from a SimpleXMLRPCServer instance or subclass instance? When running SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out the...
0
by: JDF | last post by:
I am trying to create a Windows service using SimpleXMLRPCServer and win32serviceutil. The service itself seems to be working properly (starts, stops, etc) and I can connect using an XMLRPC client...
3
by: Achim Domma | last post by:
Hi, is SimpleXMLRPCServer multithreaded or how does it handle multiple clients? I want to implement a simple server which will be queried by multiple processes for work to be done. The server...
1
by: Jan Danielsson | last post by:
Hello all, I writing an application based on the SimpleXMLRPCServer class. I would like to know the IP address of the client performing the RPC. Is that possible, without having to abandon the...
0
by: Jan Danielsson | last post by:
Hello all, I want to be able to determine the IP address of the client making an XMPRPC call. I got the tip to use this: ------------------------------- class RPCServer(SimpleXMLRPCServer):...
3
by: Sean DiZazzo | last post by:
Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? ~~~~~~~~~~~~~~~~ server.py import SocketServer from SimpleXMLRPCServer import...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
0
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...
0
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.