Information

Author(s) Vany Ingenzi, Maxime Piraux
Deadline Καμία προθεσμία
Submission limit No limitation

Ετικετές

Συνδεθείτε

[Python] Sockets - An advanced server application

In this exercise, you will implement a server for the protocol detailed in the previous task. Combine the code that you wrote previously and add the missing part for the application to be complete.

For each of the calls that you use, if one of them were to encounter an error, immediately return -1. All require headers are already included.

Manpages of interest:


Copy the function signature and fill in its body

def recv_and_handle_message(server_addr: str, server_port: int) -> int:
    # TODO: Create a IPv6 socket supporting datagrams
    # TODO: Bind it to the source
    # TODO: Receive a message through the socket
    # TODO: Perform the computation
    # TODO: Send back the result
    return 0