Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP IN PYTHON!!!!!!!!! SERVER.PY CLIENT.PY Deliverables (each worth 5 points) 1. Write a server that listens for incoming connections on the specified port. 2.

PLEASE HELP IN PYTHON!!!!!!!!!

SERVER.PYimage text in transcribed

CLIENT.PY

image text in transcribed

image text in transcribed

Deliverables (each worth 5 points) 1. Write a server that listens for incoming connections on the specified port. 2. Server must parse two command line arguments, port and log locations. 3. The server must not exit after receiving a single packet. 4. Once a client connects, it logs a message in the following format "Received connection from ". 5. Once it receives a HELLO message from the client, it logs the connection and sends a HELLO back to the client. 6. You can assume the packet format is the following: 1 Message Length (4 bytes) || | Version (4 bytes) Message type (4 bytes) 1 1 T Message (Max 10 Bytes) 7. It receives the packet header first, followed by the message. Hint: You need two RECV calls. 8. Check if Version == 17. If not, log an error message VERSION MISMATCH and continue to listen. Do not exit. 9. If Version == 17, check the message type. If message Type is 1 - the corresponding command is LIGHTON . If message type is 2 - the corresponding command is LIGHTOFF . No other command is supported. 10. If the server sees a supported command, log "EXECUTING SUPPORTED COMMAND: COMMANDNAME", else log ". 5. Once it receives a HELLO message from the client, it logs the connection and sends a HELLO back to the client. 6. You can assume the packet format is the following: 1 Message Length (4 bytes) || | Version (4 bytes) Message type (4 bytes) 1 1 T Message (Max 10 Bytes) 7. It receives the packet header first, followed by the message. Hint: You need two RECV calls. 8. Check if Version == 17. If not, log an error message VERSION MISMATCH and continue to listen. Do not exit. 9. If Version == 17, check the message type. If message Type is 1 - the corresponding command is LIGHTON . If message type is 2 - the corresponding command is LIGHTOFF . No other command is supported. 10. If the server sees a supported command, log "EXECUTING SUPPORTED COMMAND: COMMANDNAME", else log

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

Database Theory Icdt 97 6th International Conference Delphi Greece January 8 10 1997 Proceedings Lncs 1186

Authors: Foto N. Afrati ,Phokion G. Kolaitis

1st Edition

3540622225, 978-3540622222

More Books

Students also viewed these Databases questions

Question

Compare the different types of employee separation actions.

Answered: 1 week ago

Question

Assess alternative dispute resolution methods.

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic rewards.

Answered: 1 week ago