Dis Practical-4

import xmlrpc.client 
server = xmlrpc.client.ServerProxy("http://localhost:8000/") 
response = server.say_hello() 
print("Server Response:", response) 

from xmlrpc.server import SimpleXMLRPCServer

# Define the function that will be exposed remotely 
def say_hello():
    return "Hello, World from RPC!"

# Create and start the RPC server 
server = SimpleXMLRPCServer(("localhost", 8000))
print("Hello World RPC Server is running on port 8000...")

# Register the function to be called remotely
server.register_function(say_hello, "say_hello")

# Run the server indefinitely
server.serve_forever()



Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!
Scroll to Top