Sample Application
FtpView acts as a TCP server on the
data
connection, and it binds to an ephemeral port on the local IP
address. It informs the FTP server, which is the TCP client on the
data connection, of the IP address and port number of this connection
with a PORT command. We discuss this command later
in Section 11.3.4.6.
Application Startup
FtpView is essentially unchanged through
successful login to an FTP server. The login process
itself is the same as in Chapter 10. Once we are
logged in, however, things begin to change. The new screen is shown
in Figure 11-5.

Figure 11-5. FtpView after login
In addition to the Logout button, there is a new List button. When
the user presses the List button, FtpView
retrieves the FTP server’s directory listing. You will see
activity on the FTP log as the PORT and
LIST commands are sent and the data is received.
When the listing is received, FtpView displays
the results to the user. These results are shown in a primitive
dialog. We are more concerned with the mechanics of receiving them
than we are with creating a compelling user interface. The directory
screen is presented in Figure 11-6.

Figure 11-6. FtpView server directory listing
At first, this may look like something is very wrong with the data exchange. But, in fact, the problem is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access