Programming assignments(coded by GO) of Introduction to Computer Networks, NTUEE, 2021 fall.
basic unix command practice (ls
, mv
, mkdir
, rm
, etc.)
- prompts the user for the input and output filenames
- reads from the input file one line at a time
- prepends the line count to each line
- writes the line into the output file
- connects to the server that polly implements and runs already on the workstation at port 12000
- prompts the user for the upload filename
- sends first the file size (just the number in a single line)
- sends next the file content (the entire file)
- receives a message back from the server
- prints what the server says
- closes the connection and terminates the program
- listens at <your port#> until there’s an upload request
- reads from the socket first the file size (just the number in a single line)
- reads from the socket one line at a time
- prepend the line count to each line and store the new line into a new file: whatever.txt
- repeats (3) and (4) until all lines in the file is processed
- sends a message back that tells the client the original file and the new file size
- closes the connections and terminates the program
- listens at <your port#> until there’s an upload request
- reads from the socket first the file size (just the number in a single line)
- reads from the socket one line at a time
- prepend the line count to each line and store the new line into a new file: whatever.txt
- repeats (3) and (4) until all lines in the file is processed
- sends a message back that tells the client the original file and the new file size
- closes the connection and goes back to (1)
- Listens at <your port#> until there’s an upload request
- reads from the socket first the file size (just the number in a single line)
- reads from the socket one line at a time
- prepend the line count to each line and store the new line into a new file: whatever.txt
- repeats (3) and (4) until all lines in the file is processed
- sends a message back that tells the client the original file and the new file size
- closes the connections and goes back to (1)
- Listens at <your port#> until there’s an HTTP request
- reads from the socket
- finds the path and name of the text/html file requested
- In case the file exists, prints on server screen the file size
- In case the file doesn’t exist, prints on server screen “File not found”
- closes the connections and goes back to (1)