Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

ISBN: 133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

What are the logistics implications of internationalisation?

Answered: 1 week ago