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. ...
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