Thursday, September 22, 2011

How to implement a simplified version of FTP running on top of TCP in Java?

Hi, I need help on a project for my Networking class. We have to write a program that has FTP running on top of a TCP in Java. Here's the project description below.



In this project you will implement a simplified version of FTP running on top of TCP. Between you and your partner one play the client role and the other play the server role. First, the server will start up and pick a port number, and then it prints out the IP address and the port number onto the screen.

Second, the server sits there waiting for client檚 communication.

Third, Client starts up asking for IP address and port number of the server, then client binds to the socket and waits for keyboard input of an FTP.



5. You need to implement the following commands for your simplified version of FTP: pwd, ls, cd, get, put, bye.



(1) Pwd: Prints the current directory on the remote computer;

(2) ls: list the names of the files in the current remote directory;

(3) cd: Changes the working directory on the remote computer;

(4) get: Copies a remote file to the local computer using the current file transfer type

(5) Put: transfer a file from your computer to the remote computer.

(6) Bye: Ends the FTP session with the remote computer and exits ftp.How to implement a simplified version of FTP running on top of TCP in Java?
The Server creates a new ServerSocket object with a specified port and then you call the accept() method on the ServerSocket object, which will block until a client connects to that socket.

The client creates a new Socket object using the Server's IP address and port.

See the Java API and Socket tutorial, links below, for more details.

No comments:

Post a Comment