Homework
| .vscode | ||
| testdata | ||
| .gitignore | ||
| bench.sh | ||
| client.c | ||
| display_bar.c | ||
| display_bar.h | ||
| hw12.c | ||
| LICENSE | ||
| Makefile | ||
| p-client.c | ||
| p-server.c | ||
| README.md | ||
| server.c | ||
| simple_circular_buffer.h | ||
| socket_wrapper.c | ||
| socket_wrapper.h | ||
| test.sh | ||
| timerhelper.h | ||
HW12
Homework
To build source, you should install build-essential.
Usage:
./server [OPTION]...
./client SERVERNAME PORT [option] [FILENAME]...
Server OPTION and arguments:
-p port:set to port binding. couldn't set to 0-hor--help:print help message.--progress_bar:show pretty progress bar
Client option and arguments:
-bor--benchmark:benchmark mode-nvor--no-verbose:no progress bar-t [number]or--thread [number]:set to thread number.-qor--quiet:no stdout
Available macro:
For server
- DEFAULT_MAX_LISTEN_SOCKET: 16
- DEFAULT_SERVER_PORT: 9091
- DEFAULT_MAX_PATH_SIZE: 256(must be less than 1000)
- USE_SENDFILE
- DEFAULT_SEND_FILE_CHUNK_SIZE: 0x100000(1MB)
- DEFAULT_WORK_QUEUE_SIZE(server only): 10
- DEFAULT_MAX_THREAD_NUMBER(server only): 10
- DEFAULT_RESPONSE_REQUEST(p-server only): 3(-1 is INF)
- USE_TRACE
- USE_NO_QUEUE
- SLOW_SERVER(microsecond unit): if turn on sendfile option, DEFAULT_SEND_FILE_CHUNK_SIZE/SLOW bytes/usec, otherwise (buf_size/SLOW_CLIENT) bytes/usec
For client
- MUL_CLIENT(second unit)
- SLOW_CLIENT(microsecond unit, (buf_size/SLOW_CLIENT) bytes/usec)
For both
- TIMEOUT: 5(second unit)
- DEFAULT_MAX_TERMINAL_ROW: 1000
- DEFAULT_PROGRESS_BAR_WIDTH: 30