In this chapter, we extend our sample application
FtpView to log in to and out of the FTP server.
This involves connecting to the server, sending the
PASS commands, and
receiving and handling responses. FTP login and logout provide
excellent examples of exchanging data across the network.
Figure 9-2 shows the screen after the application has initialized. From a user input perspective, little has changed. In Chapter 8, on the initial screen, the log table contains quite a few messages. In this chapter’s version, the log table has only one entry. There is also a “Connect” button at the bottom of the screen in Chapter 8. This has been replaced with the login button. At the top right of the screen is a new pop-up trigger labeled “FTP,” as shown in Figure 9-2.
Figure 9-2. Sample application at startup
We have added an FTP log to the networking one. The FTP log is filled with events such as initialization, sending commands, and receiving responses. The Network log is filled with events such as connecting to the network, resolving host and service names, and sending or receiving data. The networking events are the details of the associated FTP events.
On startup, the FTP log has only one entry. If we look at the network log, we see that quite a few events have been logged. Figure 9-3 shows the network log for application startup.
Figure 9-3. Sample ...