Sample Application
FtpView
’s end-user functionality is
unchanged from Chapter 9. Except for a marked
improvement in responsiveness, the application appears identical.
Under the hood, significant revisions have been made to enable this
responsiveness. Since the screens are pretty much the same, we jump
straight to the code changes. But before we get to the code itself,
we need to design our state machine at a more detailed level. Then we
explore the implementation.
Designing the State Machine
Each time it receives a nilEvent
, our application
gives the
FTP session a chance to send outbound commands, receive inbound
responses, connect to and disconnect from servers, and update the
state information. This is handled by the new FTP module function,
PnpFtpProcess
.
For network applications, we don’t necessarily want to wait for
an event to occur. We want to be sure and give the application
protocol stack a chance to handle network events. We do this by
passing a valid timeout to EvtGetEvent
. When this
timeout expires, the application receives a
nilEvent
. When we read a transaction off the queue, it becomes the current transaction. ...
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.