C H A P T E R 2 2
Using the Transport Interface
if dataDef then
item.fromRef := dataDef:MakeNameRef(persona,
// add other slots or extract routing info here
During a receive operation, the transport itself must invoke the
method to get a new In/Out Box item frame. This method copies most slots from
the received item to the new In/Out Box item frame. Additionally, it inserts the
slot value (if included) in the received frame into the
slot in the new frame.
Finally, the transport should call
to register the item in the In
Box (see the following section).
Completion and Logging
After your transport finishes processing an item (either sending or receiving, with
or without errors), you must send the transport the message
This method must be used when an item is altered in any way. It performs several
operations, including setting the state and error status of the item; sending the
callback message to the application; handling error
conditions; and saving, logging, or deleting the item, depending on the logging
message only after your transport has completely
processed an item. If you send this message before you know that the item was
delivered successfully, for example, there's a possibility that the item will be lost.
was called as the result of an error, it calls
translate the error code and notify the user. If you want to perform your own error
notification, you can override the
Note that the
callback message to the application only if the item
slot that is set to
. You must set this slot
if you want the callback message to be sent. For more information on
see Newton Programmer's Reference (page 18-33).
To perform logging,
sends your transport the message
, passing a log entry to which you can add slots. The
object includes a default
method, but you
should override this method to add transport-specific slots to the log entry.
The default method simply adds a
slot to the log entry. The
transport method is called to get the title.