# TP_AIPS - Groupe : 3IR C 2023-2024 - Étudiants : - LACAU Clement - ALNET Paul ## Building Compile version `X` : ``` gcc -Wall -Wpedantic tsock_vX.c -o t_sockvX ``` Or compile all versions: ``` gcc -Wall -Wpedantic tsock_v1.c -o t_sockv1 gcc -Wall -Wpedantic tsock_v2.c -o t_sockv2 gcc -Wall -Wpedantic tsock_v3.c -o t_sockv3 gcc -Wall -Wpedantic tsock_v4.c -o t_sockv4 ``` Generate zip archive (replace `TP1` with relevant indication) : ``` zip LACAU-ALNET-TP1.zip tsock_v*.c README.md ``` ## Running ``` usage: ./t_sockv1 <-u> [-ps] [host] parameters: host With -s, address of the host to connect to. Required with -s. port Port to connect or bind to. Required. options: -p Runs a TCP/UDP sink. Incompatible with -s. -s Runs a TCP/UDP faucet. Incompatible with -p. -u Use UDP instead of TCP. Required. usage: ./t_sockv2 [-psu] [host] parameters: host With -s, address of the host to connect to. Required with -s. port Port to connect or bind to. Required. options: -p Runs a TCP/UDP sink. Incompatible with -s. -s Runs a TCP/UDP faucet. Incompatible with -p. -u Use UDP instead of TCP. usage: ./t_sockv3 [-psu] [-n nb_messages] [-l mess_length] [host] parameters: host With -s, address of the host to connect to. Required with -s. port Port to connect or bind to. Required. options: -l mess_length Size of the messages to send. Min 5. Max 1400. Default 30. -n nb_messages Number of messages to send. Min 1. Default 10. Ignored with -p. -p Runs a TCP/UDP sink. Incompatible with -s. -s Runs a TCP/UDP faucet. Incompatible with -p. -u Use UDP instead of TCP. ``` Example usage of v3 : ``` ./t_sockv3 -p -l 15 4000 # receiver ./t_sockv3 -s -l 15 localhost 4000 # sender ``` Example usage of v4 : ``` ./t_sockv3 -C -e -n 20 -l 15 localhost 4000 # client sender ./t_sockv3 -S -r -n 20 -l 15 4000 # server receiver ``` ## Roadmap - [X] tsock-v1 - [X] tsock-v2 - [X] tsock-v3 - [X] tsock-v4 - [X] server can handle multiple requests simultaneously - [X] server doesn't stop after the connection ends - [X] both client and server can assume sender/receiver roles