Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

-Replicate and Enhance this echo client/Server program from socket import * serverName = servername serverPort = 12000 clientSocket = socket(AF_INET, SOCK_STREAM) clientSocket.connect((serverName,serverPort)) sentence = raw_input(Input

-Replicate and Enhance this echo client/Server program

from socket import *

serverName = servername

serverPort = 12000

clientSocket = socket(AF_INET, SOCK_STREAM)

clientSocket.connect((serverName,serverPort))

sentence = raw_input(Input lowercase sentence:)

clientSocket.send(sentence)

modifiedSentence = clientSocket.recv(1024)

print From Server:, modifiedSentence

clientSocket.close()

Choose either TCP or UDP version of the echo server/client, modify it to accomplish the following function: Server side program should accept a parameter as the port number that it will listen on for incoming request, if no parameter is provided, then 9999 is used by default. User(e.g. me) runs the client program to connect to server. Client program should accept two parameters that allow user to specify the server address and port number. The client program reads a sentence typed in by user via keyboard, and user can select a command, then it sends both the command and the sentence to the server. Upon receipt of the sentence and command, server converts all the letters in the sentence into uppercase letters or lower letters or other format based on the received command, and sends the result back to the client. Client program displays the replied sentence on the screen. Your server should support at least three commands: all uppercase, all lowercase, and another commands that you designed(something like initial caps, reverse each word, reverse the entire sentence, etc.). Make sure test your program before submission, you'll receive 0 if your programs contains syntax errors! Include a README document for instructions on how to run your program.

-provide a document describing your protocol, i.e., underlying transport layer service, port numbers, the order and format of message sent and received by client/server, action associated with each message, etc. The document should provide enough information for others to implement client and server program to interact with yours.

How TCP or UDP would affect your application? Why you pick TCP over UDP?(Or vice versa) Is your protocol stateful or stateless? How does the other type of design would affect your application? (Hint: this has nothing to do with whether you use TCP or UDP). Is your server program able to communicate with multiple clients at the same time?

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_2

Step: 3

blur-text-image_3

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

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students explore these related Databases questions