Question: 1/ write a python program 2/ Do not submit a pre-existing solution from Chegg because what is required is different 2. Check server.py and client.py

1/ write a python program
2/ Do not submit a pre-existing solution from Chegg because what is required is different
 1/ write a python program 2/ Do not submit a pre-existing
solution from Chegg because what is required is different 2. Check server.py

2. Check server.py and client.py code and answer the questions below. \# Client from socket import * s=socket(AF INET, SOCK_DGRAM) host = 'I27.0.0.l' port =1234 buf =1024 addr = (host,port) req = input("Enter the filename and the line number needed separated by comma: (n) \#Example: req = book2.txt, 5 s.sendto(req.encode('ascii'), addr) print("Data requested.") data, addr = s.recvfrom(buf) print(data.decode ( ) ) s.close0 \# Server from socket import * host =127.0.0.1 port =1234 s=socket(AFINET,SOCK DGRAM) s.bind ((host,port)) addr= (host,, port) buf =1024 data.addr = s.recvfrom(buf) data = data.decode 0 data = data.split(:') f=open(data[0],r ' ) lines = f. readlines 0 index = int ( data [1])1 s.sendto(lines[index].encode('ascii'), addr) s.close 0 - 1 - What modification(s) can you do to the code \#1 and code \#2 to make the server and client use the TCP Protocol? - 2 - Modify the server code to send an error to the client if the file requested does not exist. - 3 - Modify the server code to send an error to the client if the line requested does not exist. - 4 - Modify the client code to request the last line if the client didn't write a line number in their request. Example req = 'book2.txt

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!