Question: Write two socket programs - one that serves as an ftp server and the other that serves as an ftp client. Name the programs as

Write two socket programs - one that serves as an ftp server and the other that serves as an ftp client. Name the programs as ftp_server.c and ftp_client.c and their executables as ftp_server and ftp_client. The ftp_server program should be run on port 12000 and in the background and should be able to serve 5 simultaneous connections. The ftp_client program should take two values as command line arguments (one for the server IP address and the other for the server port number). It should establish a connection with the ftp_server and display a message to the user that the connection has been established successfully. The ftp_client user should be able to see all files available in the ftp directory on the server and client by typing the ls server and ls client commands respectively. The ftp_client user should be able to upload and download files from the ftp_server. Note: The server and the client programs will be tested using two different servers. If you do not have access to multiple machines, you can use grok to test both the server and client programs. Note: While testing do not run the ftp_server and ftp_client programs from the same directory. You may risk losing your data SAMPLE OUTPUT $ ./ftp_server 12000 & [1] 22816 $ ./ftp_client 192.168.2.3 12000 Connection successfully established with the ftp server ftp> ls server (displays files on the server) 1. 123.txt 2. ftp_server 3. ftp_server.c 4. hello 5. hello.c If you wish to download a file enter d followed by the file number ftp> d 5 ftp> File hello.c downloaded successfully. 64 bytes received. ftp> ls client (displays files on the client) 1. datafile.txt 2. ftp_client 3. ftp_client.c 4. hello.c 5. list.dat 6. program 7. program.c If you wish to upload a file enter u followed by the file number ftp > u 5 ftp > File list.dat uploaded successfully. 2857554 bytes sent. ftp > ls server 1. 123.txt 2. ftp_server 3. ftp_server.c 4. hello 5. hello.c 6. list.dat ftp> bye Closing the connection $

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!