FtpView is a limited FTP client application
in this book, which provides only enough functionality to demonstrate
the usage of TCP sockets. We demonstrate establishing and accepting
connections and exchanging data over these connections.
FtpView illustrates these techniques by
supporting login to an FTP server, listing the server’s current
directory, and logging out from the server.
FtpView provides moderate, read-only access to
FTP servers. We
develop this application in Chapter 6 through Chapter 12.
FtpView will allow the user to
log in to and out from the FTP server, and retrieve the listing of
files in the server’s root directory. Figure 3-1 shows the application flow for
Figure 3-1. FtpView application flow
When the user starts the application, the only available option is to begin an FTP session. Once the session has begun, the user can list the server directory contents or log out. The user can list the server directory as often as they like during the session, but when the user logs out from the FTP server, the session is ended and she is back where she started. The user must begin a new session by logging in to an FTP server again before she can list the server files or log out again. We will examine in turn each of the following FTP operations: login, list, and logout.
The user starts an FTP session ...