Homework
Go to file
ubuntu201711081 fb7646fac7 add tty_fd 2020-12-14 10:20:16 +00:00
.vscode add server progress bar 2020-12-07 17:59:11 +00:00
testdata fix progress bar deadlock 2020-12-08 16:49:50 +00:00
.gitignore update p-client 2020-12-08 17:34:13 +00:00
LICENSE Initial commit 2020-12-04 07:28:31 +09:00
Makefile use client display bar 2020-12-08 15:15:12 +00:00
README.md chg README 2020-12-08 15:21:54 +00:00
bench.sh add simple bench script 2020-12-08 15:20:59 +00:00
client.c fix progress bar deadlock 2020-12-08 16:49:50 +00:00
display_bar.c add tty_fd 2020-12-14 10:20:16 +00:00
display_bar.h add comment 2020-12-14 10:19:49 +00:00
hw12.c add base 2020-12-03 23:06:26 +00:00
p-client.c update p-client 2020-12-08 17:34:13 +00:00
p-server.c fix some bug 2020-12-08 11:37:54 +00:00
server.c add comment 2020-12-14 10:19:49 +00:00
simple_circular_buffer.h add threadpool server 2020-12-05 01:30:30 +00:00
socket_wrapper.c add threadpool server 2020-12-05 01:30:30 +00:00
socket_wrapper.h add macro to change setting 2020-12-04 08:33:41 +00:00
test.sh fix some bug 2020-12-06 12:26:38 +00:00
timerhelper.h add comment 2020-12-14 10:19:49 +00:00

README.md

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
  • -h or --help :print help message.
  • --progress_bar :show pretty progress bar

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.
  • -q or --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