You will need to write simple file transfer client and server in language C
.
Please modify the sample code to achieve this goal.
Fill in your own code by following the TODO Hint in the code.
/**
TODO:
print something here.
**/
You can click Download ZIP
to download a zip file directly
- Install
Git
on your system$ sudo apt-get install git
- Open command prompt
- Input
git clone https://github.com/HSNL-TAs/2016-ITCN-file-transfer.git
What in makefile
all: server.c client.c
gcc server.c -o server
gcc client.c -o client
clean:
rm -rf server
rm -rf client
$ make
$ ./server 8888
Open another termial.
$ ./client 127.0.0.1 8888
-
User can assign port to server
-
Returns files list to client when the client connects immediately to the server. (We have provided this function which scans all the file under the same directory.)
# Client side $ ./client 127.0.0.1 8888 [✓] Connect to server. [✓] Server reply! ----------- Files on server: lab3_2_spec.pdf test.png test.txt ----------- Enter the filename:
-
Returns files which client wants to download.
# Client side Enter the filename: test.txt [-] Downloading `test.txt` ... [✓] Download successfully! ----------- Enter the filename: # user can continue to send download request.
- User can assign ip address and port to connect the server with command line argument.
- Support user inputs the file name to download file from server, per file per input.
- Input
.exit
to disconnect from server.
NOTE: Server and client should keep connected unless user inputs .exit
Please also uplaod your code and a screenshot of your result to ilms system.
( Package them as .zip
format and name after your student ID)
- Deadline: 100%, before 2016/11/20 23:59 (Sun.)
- Deadline: 80%, before 2016/11/27 23:59 (Sun.)
- Deadline: 60%, before 2016/12/4 23:59 (Sun.)
After 2016/12/4, your submission is not accepted.
Please feel free to ask questions at
- Here, or
- On the iLms forum, or
- Come at Office Hour (15:30 ~ 17:20 on Wednesday, 綜二 705)