
Communications
Overview Q & A

This document is a collection of commonly asked questions and their
answers. It includes the answers to questions posed in the module introduction
as well as others based on student responses. It can be used either as answers
to questions you might have had while working in this module or as a check
to measure your understanding of the topic.
Marginal notes have been added which describe where within the module the
answers to the questions may be found.
Q&A
1. Name the major components of the 2.0 communications system and give and
example when you might use each of them in an application.
Components: Routing, I/O Box, Transports, Endpoints, Low-level communication
tools. Routing is used when an application wants to send data to the I/O
Box. There is actually no communications code written by the application.
The I/O Box is used as a store and forward mechanism. An application programmer
sends things to the I/O Box application by routing code. Incoming data is
put away by sending the appropriate message from the I/O Box to the application.
If the programmer has written a custom transport, it will interact with
the I/O Box application to get outgoing items or to store incoming items.
Transports are used when a programmer wants to make a system-wide service
available for moving routed data from one place to another.
Endpoints are the main NewtonScript API for communications programming.
For example, an application might write endpoint code to provide an immediate,
point-to-point communications link within the body of a NewtonScript program.
Low-level communications tools provide an API for filtering or otherwise
manipulating the data before it is sent out of the Newton. Compression or
encryption might be built as a low-level communication tool. This API is
currently not available for most Newton programmers.
2. Summarize the lifecycle of an endpoint.
Endpoints normally go through the following phases:
Instantiation - creates a NewtonScript endpoint object
Connecting - connects to a remote device
Binding - binds to an address
Input and Output - send and receives data
Unbinding - unregisters address
Disconnect - disconnects from remote device
Dispose - NewtonScript endpoint object is destroyed
3. What DIL code runs on the Newton?
None. DIL code runs on a desktop machine. On the Newton endpoint code supplies
the communication to a DIL.
4. Can endpoint calls be made asynchronously? DIL calls?
Yes to both questions. On a Newton a callback can be supplied by adding
a callback frame. In DILs a callback routine can be passed in as an argument
to a number of routines.
5. What part of the communications system do transports interact with?
Transports always interact with the I/O Box application and often with the
endpoint system. The I/O Box is where requests for outgoing data are stored
before being passed to a transport and where a transport stores incoming
data before it is passed to a receiving application by the I/O Box application.

Developer
Services | Technical Information
| Tools | Sample
Code
Main | Page
One | What's New | Apple
Computer, Inc. | Find It | Contact
Us | Help
Copyright
Apple Computer, Inc.
Maintained online by commscourse@newton.apple.com
Updated 26-Sep-96 by pmr