C H A P T E R 2 2
Using the Transport Interface
Some transports may ignore the
message, since they receive
data continuously. Others may use this message as a trigger to initiate a connection.
You can choose to comply with or ignore any request to receive, depending on the
communication resources available and their status. If you choose to comply, the
method should establish a connection and begin receiving by
whatever means the transport uses to communicate. For example, many transports
use the Endpoint interface to establish and operate a connection. After receiving the
item, you should call the transport method
to copy it into a
standard item frame used by the In/Out Box. Finally, you must call
to write the item to the In Box.
If your transport creates virtual binary objects, you must use the method
to determine on which store to create them.
slot within every received item must have a
to identify its data class. Data objects received from other Newton
devices always have a
slot. For data received from other
systems, your transport must assign a meaningful class to the
Deferring Reception of the Item Data
Some transports might want to download just part of an item initially, such as its
title, then download the actual item data when a user requests it. For example, upon
connection an e-mail transport might download just the titles of messages or other
data objects. When the user attempts to view one of these items in the In Box, the
transport then downloads the body of the item from the remote host.
This feature is accomplished by the use of the
slot in the parameter passed
method, and by the use of a
slot in the item frame.
If a transport initially downloads just a part of each item, such as its title, it must
insert a slot called
, whose value is
in the item frame of those items.
This slot serves as a flag to tell the In/Out Box that the body of the item is stored
remotely and has not yet been downloaded.
When the user attempts to view one of these items in the In Box, the In Box sees
slot, and sends the transport the
message with the
cause. This alerts the transport to download the body of the item from
the remote host. If the user selected multiple remote items for downloading, you
must use the
method to retrieve subsequent requested items and
download them. Keep calling
until it returns
, which signals
that there are no more items to retrieve.