By Greg Winton
Price: $39.95 USD
£28.50 GBP
Cover | Table of Contents | Colophon
NetLib) provided the
developer with access to this protocol stack.
|
Chapter
|
Description
|
|---|---|
|
6
|
Base: open and close network connection
|
|
7
|
Base: resolve hosts and services
|
|
8
|
FtpView: connect to sockets
|
|
9
|
FtpView: exchange data with FTP server (scripted)
|
|
10
|
FtpView: exchange data with FTP server
(event-driven)
|
|
11
|
FtpView: listen for and accept connection
requests
|
|
12
|
FtpView: use nonblocking Sockets
|
|
13
|
http://www.palmos.com/dev/tech/tools.
sysFtrNumROMVersion
feature. If you don't know how to retrieve features,
don't panic. We describe this in Chapter 6,
when we discuss how to load, initialize, and open the Net Library.
NetLibOpen
to load and initialize the protocol stack:
Err NetLibOpen (UInt16 netLibRefNum, UInt16* ifErrsP);
*ifErrsP.
NetLibOpen reads the network configuration
information from the preferences database. It then loads and
initializes the appropriate components of the network protocol stack.
Any changes to the configuration made after
NetLibOpen has been called have no effect until
the protocol stack, or the specific interface to which the setting
pertains, is shut down and loaded again.
NetLibOpen also creates a new task on the
operating system for the protocol stack to run on, and initializes
the mailbox queues that allow this task to communicate with the user
interface task.
NetLibOpen
is called on. The drivers may display a dialog to show the progress
of establishing a connection to the server.
NetLibOpen must therefore
be called from the user interface
task.
NetLibClose:
Err NetLibClose (UInt netLibRefNum, Boolean immediate);
immediate parameter indicates whether you want
the Net Library to close immediately. This controls how the library
is closed down. If this parameter is true, the protocol stack closes
down as soon as it receives the request from the mailbox queue. If
this parameter is set to false, the protocol stack starts a countdown
to allow other applications, or even your same application, the
opportunity to call NetLibOpen. If this occurs
before the countdown reaches 0, the close is aborted and the protocol
stack is not unloaded. This saves the user from the pain of waiting
while connections are made and the protocol stack loads.