2020-12-04 07:28:31 +09:00
|
|
|
# HW12
|
|
|
|
|
2020-12-04 17:33:41 +09:00
|
|
|
Homework
|
|
|
|
|
|
|
|
To build source, you should install `build-essential`.
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
```bash
|
|
|
|
./server [OPTION]...
|
2020-12-06 02:33:41 +09:00
|
|
|
./client SERVERNAME PORT [option] [FILENAME]...
|
2020-12-04 17:33:41 +09:00
|
|
|
```
|
|
|
|
|
2020-12-04 18:08:49 +09:00
|
|
|
Server OPTION and arguments:
|
2020-12-06 02:55:36 +09:00
|
|
|
- `-p port` :set to port binding. couldn't set to 0
|
|
|
|
- `-h` or `--help` :print help message.
|
2020-12-04 18:08:49 +09:00
|
|
|
|
2020-12-06 02:33:41 +09:00
|
|
|
Client option and arguments:
|
2020-12-06 02:55:36 +09:00
|
|
|
- `-b` or `--benchmark` :benchmark mode
|
2020-12-06 13:12:20 +09:00
|
|
|
- `-nv` or `--no-verbose` :no progress bar
|
2020-12-06 21:26:38 +09:00
|
|
|
- `-t [number]` or `--thread [number]` :set to thread number.
|
2020-12-07 19:49:29 +09:00
|
|
|
- `-q` or `--quiet` :no stdout
|
2020-12-06 02:33:41 +09:00
|
|
|
|
2020-12-04 18:08:49 +09:00
|
|
|
Available macro:
|
2020-12-05 10:25:54 +09:00
|
|
|
|
|
|
|
For server
|
|
|
|
- DEFAULT_MAX_LISTEN_SOCKET: 16
|
|
|
|
- DEFAULT_SERVER_PORT: 9091
|
|
|
|
- DEFAULT_MAX_PATH_SIZE: 256(must be less than 1000)
|
2020-12-04 17:33:41 +09:00
|
|
|
- USE_SENDFILE
|
2020-12-05 10:25:54 +09:00
|
|
|
- DEFAULT_SEND_FILE_CHUNK_SIZE: 0x100000(1MB)
|
2020-12-06 02:39:15 +09:00
|
|
|
- DEFAULT_WORK_QUEUE_SIZE(server only): 10
|
|
|
|
- DEFAULT_MAX_THREAD_NUMBER(server only): 10
|
|
|
|
- DEFAULT_RESPONSE_REQUEST(p-server only): 3(-1 is INF)
|
2020-12-07 00:26:59 +09:00
|
|
|
- USE_TRACE
|
2020-12-07 02:19:14 +09:00
|
|
|
- USE_NO_QUEUE
|
2020-12-08 14:06:17 +09:00
|
|
|
- SLOW_SERVER(microsecond unit): if turn on sendfile option, DEFAULT_SEND_FILE_CHUNK_SIZE/SLOW bytes/usec, otherwise (buf_size/SLOW_CLIENT) bytes/usec
|
2020-12-06 02:55:36 +09:00
|
|
|
|
2020-12-05 10:25:54 +09:00
|
|
|
For client
|
2020-12-05 11:13:13 +09:00
|
|
|
- MUL_CLIENT(second unit)
|
|
|
|
- SLOW_CLIENT(microsecond unit, (buf_size/SLOW_CLIENT) bytes/usec)
|
2020-12-05 10:25:54 +09:00
|
|
|
|
|
|
|
For both
|
2020-12-08 14:06:17 +09:00
|
|
|
- TIMEOUT: 5(second unit)
|
2020-12-08 23:37:10 +09:00
|
|
|
- DEFAULT_MAX_TERMINAL_ROW: 1000
|
2020-12-08 14:06:17 +09:00
|
|
|
- DEFAULT_PROGRESS_BAR_WIDTH: 30
|