Answered step by step
Verified Expert Solution
Question
1 Approved Answer
from socket import * serverPort = 9999 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind(('',serverPort)) serverSocket.listen(2) print ('The server,',serverPort, ', is ready to receive sentence from client') while 1:
from socket import * serverPort = 9999 serverSocket = socket(AF_INET,SOCK_STREAM) serverSocket.bind(('',serverPort)) serverSocket.listen(2) print ('The server,',serverPort, ', is ready to receive sentence from client') while 1: connectionSocket, addr = serverSocket.accept() choice = connectionSocket.recv(1024) sentence = connectionSocket.recv(1024) if choice == 1: capitalized1stLetter = sentence.title()# leaves the first letter of the word in capitals connectionSocket.send(capitalizedSentence) elif choice == 2: capitalizedSentence = sentence.upper()# leaves the entire message in Capitals connectionSocket.send(capitalized1stLetter) elif choice == 3: lowercaseSentence = sentence.lower()# leaves the entire message in lowercase connectionSocket.send(lowercaseSentence) connectionSocket.close()
This is a program is python. The program name is TCP Server. i just need to change it up. please edit it or put comments in it on whatever you feel like doing in it. but just change it up and make sure it runs and let me know which pyhotn terminal(3.2 or 2.0) did you use.
Please do this ASAP, I need it in couple of hours. Thank you in advance and I promise to give you a thumbs up!!!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started