beautypg.com

Using the endpoint interface 23, Setting endpoint options 23 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 836

background image

C H A P T E R 2 3

Endpoint Interface

23-8

Using the Endpoint Interface

Multiple communication sessions. The system now supports multiple
simultaneous communication sessions. In other words, you can have more than
one active endpoint at a time.

Using the Endpoint Interface

23

This section describes

setting endpoint options

initializing and terminating an endpoint

establishing a connection

sending data

receiving data

sending and receiving streamed data

working with binary data

canceling operations

handling errors

linking the endpoint with an application

Setting Endpoint Options

23

Endpoint options are specified in an endpoint option frame that is passed as an
argument to an endpoint method. Typically you specify an array of option frames,
setting several options at once. Note that you cannot nest an option array inside
another one.

You must specify a single

'service

option, to select a communication tool. Then

you usually specify one or more

'option

options to configure the communication

tool—for example, to set the baud rate, flow control, and parity of the serial tool.
Note that if you are using the modem communication tool, you can use the utility
function

MakeModemOption

to return a modem dialing option for use with the

built-in modem tool.

You may also need to specify an

'address

option, depending on the communi-

cation tool you are using. The only built-in tools that use an

'address

option are

the modem and AppleTalk tools. Note that you should use the global functions

MakePhoneOption

and

MakeAppleTalkOption

to construct

'address

options for the modem and AppleTalk tools.

The slots in an endpoint option frame are described in detail in “Endpoint Option
Frame” (page 20-7) in Newton Programmer’s Reference.