Question: Python(using Socket-API and XML-RPC programming). Q1: Use BOTH methods (1) Socket-API, (2) XML-RPC and python programming languages. References: Socket Python https://docs.python.org/2/howto/sockets.html XML-RPC Python2 https://docs.python.org/2/library/xmlrpclib.html Python3

Python(using Socket-API and XML-RPC programming).

Q1:

Use BOTH methods (1) Socket-API, (2) XML-RPC and python programming languages.

References:

Socket

Python https://docs.python.org/2/howto/sockets.html

XML-RPC

Python2 https://docs.python.org/2/library/xmlrpclib.html

Python3 https://docs.python.org/3/library/xmlrpc.client.html

Please write 1) your source code, and 2) a report with screenshots, description of your code, and answers to the writing problems..

Q1-1. Programming Problem

Implement a service with the following functionalities: 1) If the client sends a string message, server simply replies with I have received your message XXX(message content). 2) If the client sends a request to add multiple numbers, server replies with the result.

Examples:

Client sends: Hello There!

Server replies: I have received your message Hello There!

Client sends: Add,[1,2,3,4,5]

Server replies: Sum([1,2,3,4,5]) = 15 (The format could be flexible. Its fine if the server only returns 15)

Client sends: Add,[1,2,3]

Server replies: Sum([1,2,3]) = 6

NOTE: The messages from client or server should be generated by client/server, not printed at the other side.

Hint: In socket programming, client sends a request in the format , if TYPE=0, we get MESSAGE; if TYPE=1, MESSAGE contains a list of the numbers.

Hint: you can implement this based on the examples given in the class. The source code is posted on class website.

Please include screenshots of your results and the command you use to run the code.

Q1-2. Programming+Written Problem

Compare the performance(latency) of the two methods for the two functions. (Screenshots of the time should be good enough. Please include the code in your scripts).

Q1-3. Written Problem

Compare the differences of socket-API and XML-RPC. If we are going to implement a distributed system where multiple servers interact with each other, which one is better? Why?

Optional:

Extend the implementation. Define an application that is not a straightforward extension and implement it. Examples: make a multithreading version, implement an interactive protocol (client and server exchange several rounds of information), etc.

Inlcude screenshots, commands to run your code in the report.

Q1-2. Programming+Written Problem

Compare the performance(latency) of the two methods for the two functions. (Screenshots of the time should be good enough. Please include the code in your scripts).

Q1-3. Written Problem

Compare the differences of socket-API and XML-RPC. If we are going to implement a distributed system where multiple servers interact with each other, which one is better? Why?

Optional:

Extend the implementation. Define an application that is not a straightforward extension and implement it. Examples: make a multithreading version, implement an interactive protocol (client and server exchange several rounds of information), etc.

Inlcude screenshots, commands to run your code in the report.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!