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 ...
Get Palm OS Network Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.