Skip to content

Commit 0f7ef6c

Browse files
committed
io/optimizations: Add checker for async-server
Added a checker for async-server. Added `make check` rule to the Makefile. Updated README.md with checker instructions. Modified the `test-file` size that is being sent from 1GB to 100MB, so the checker can run in a shorter time. Signed-off-by: Rares Balcan <[email protected]>
1 parent 19b9d54 commit 0f7ef6c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

chapters/io/optimizations/drills/tasks/async-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ After uploading the file, the clients close the connection.
1515
If successful, the clients should print the upload progress.
1616

1717
To run the checker, run `make check` from the `support` file. You may have to wait a little bit for the checker to be finish its execution.
18-
In case of the checker failing, check out client and server output in the `client_output.log`, `server_output.log` in the `support` file.
18+
In case of the checker failing, check out client and server output in the `client_output.log`, `server_output.log` in the `support` file.
1919

2020
1. There is a problem with our current implementation.
2121
Try to start two clients at the same time - the first one will start uploading, and the second one will block at `connect()`.

chapters/io/optimizations/drills/tasks/async-server/solution/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ check:
4242
cd ../tests && \
4343
chmod +x check_server.sh && \
4444
./check_server.sh
45-
45+
4646
.PHONY: all clean

chapters/io/optimizations/drills/tasks/async-server/tests/check_server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
# SPDX-License-Identifier: BSD-3-Clause
23

34
TEST_FILE="../support/test-file.txt"
45
if [ ! -f "$TEST_FILE" ]; then
@@ -11,7 +12,6 @@ SOLUTION_DIR="../solution"
1112
PORT=5000
1213

1314
SERVER_BIN="$SUPPORT_DIR/server"
14-
CLIENT_BIN="$SOLUTION_DIR/client"
1515
SERVER_LOG="$SUPPORT_DIR/server_output.log"
1616
CLIENT_LOG="$SUPPORT_DIR/client_output.log"
1717
REF_CONFIRMATION="Received 100MB file from"
@@ -25,7 +25,7 @@ rm -f "$SERVER_LOG" "$CLIENT_LOG"
2525
PID_LIST=$(lsof -ti tcp:$PORT)
2626
if [ -n "$PID_LIST" ]; then
2727
echo "Killing previous server processes on port $PORT: $PID_LIST"
28-
kill -9 $PID_LIST
28+
kill -9 "$PID_LIST"
2929
sleep 1
3030
fi
3131

0 commit comments

Comments
 (0)