The assignment requires creating a server that sends a specific file to clients in a defined byte format, including the file name length and content. The server must listen on IP address 127.0.0.1 and Port 8000, with the file name provided as a command line argument. Both server and client applications should be console-based, and testing involves building and running each project separately.
The assignment requires creating a server that sends a specific file to clients in a defined byte format, including the file name length and content. The server must listen on IP address 127.0.0.1 and Port 8000, with the file name provided as a command line argument. Both server and client applications should be console-based, and testing involves building and running each project separately.
• Server sends a specific file to every client that
connects to it. • The file name should be sent with the file data in the same byte array.
• The first 4 bytes should represent an integer that
represents the length of the file name. • If the file name is “file.txt” and has “abcdefgh” as content then the first 4 bytes should be the binary representation of the number “8” (length of “file.txt”) Assignment • Then the next 8 bytes should represent the 8 characters of the file name “file.txt” – byte #4 -> ascii of ‘f’ – byte #5-> ascii of ‘i’ – …. 0 0 0 8 f i l e . t x t a b c d e f g h
• The rest of the bytes should be the file contents.