HW12/README.md
ubuntu201711081 d02eb2e69c fix some bug
2020-12-06 12:26:38 +00:00

40 lines
989 B
Markdown

# HW12
Homework
To build source, you should install `build-essential`.
Usage:
```bash
./server [OPTION]...
./client SERVERNAME PORT [option] [FILENAME]...
```
Server OPTION and arguments:
- `-p port` :set to port binding. couldn't set to 0
- `-h` or `--help` :print help message.
Client option and arguments:
- `-b` or `--benchmark` :benchmark mode
- `-nv` or `--no-verbose` :no progress bar
- `-t [number]` or `--thread [number]` :set to thread number.
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)
For client
- MUL_CLIENT(second unit)
- SLOW_CLIENT(microsecond unit, (buf_size/SLOW_CLIENT) bytes/usec)
- DEFAULT_PROGRESS_BAR_WIDTH: 30
For both
- TIMEOUT: 5(second unit)