Heard it's similar to a1, but this time the server needs to parse client's commands and send back responses
We can test it using a1 or netcat
-
In /test/server.c, we will mostly look at accept() and send()
-
How to compile and run C in Unix:
gcc -o out some_name.c
./out
-
How to debug?
-
Everything should be compiled in Unix
Be careful when look up usage of C functions. Many only apply to Windows
A reliable source is to use command: man <function_name>, choose 3
-
we only deal with one client here
-
eventually should test it with client: ftp ftp.cs.ubc.ca(should be localhost?) 3500 (don't choose port below 1024)
-
raw ftp command reference
-
socket workflow
-
You might find the Unix library routines strncmp(), toupper(), or the whole set of regex routines helpful
Heard it's similar to a1, but this time the server needs to parse client's commands and send back responses
We can test it using a1 or netcat
In /test/server.c, we will mostly look at accept() and send()
How to compile and run C in Unix:
gcc -o out some_name.c
./out
How to debug?
Everything should be compiled in Unix
Be careful when look up usage of C functions. Many only apply to Windows
A reliable source is to use command: man <function_name>, choose 3
we only deal with one client here
eventually should test it with client: ftp ftp.cs.ubc.ca(should be localhost?) 3500 (don't choose port below 1024)
raw ftp command reference
socket workflow
You might find the Unix library routines strncmp(), toupper(), or the whole set of regex routines helpful