Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 5 - AppleTalk Data Stream Protocol (ADSP) / ADSP Reference
Routines / Maintaining an ADSP Connection and Using It to Exchange Data


dspAttention

The dspAttention routine sends an attention code and an attention message to the remote connection end. You use the PBControl function to call the dspAttention routine. See "Routines" on page 5-43 for a description of the PBControl function.

-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe function result.
-->ioCRefNumIntegerThe driver reference number.
-->csCodeIntegerAlways dspAttention for this function.
-->ccbRefNumIntegerThe CCB reference number.
-->attnCodeIntegerThe client attention code.
-->attnSizeIntegerThe size of attention data in bytes.
-->attnDataPtrA pointer to attention data.

Field Description
csCode
The routine selector, always dspAttention for this routine.
ccbRefNum
The connection control block (CCB) reference number that the dspInit routine returned.
attnCode
The 2-byte attention code that you wish to send to the remote connection end. You can use any value from $0000 through $EFFF for the attention code. The values $F000 through $FFFF are reserved for use by ADSP.
attnSize
The size in bytes of the attention message you wish to send.
attnData
A pointer to the attention message. The attention message can be any size from 0 through 570 bytes. There are no restrictions on the content of the attention message.
DESCRIPTION
The dspAttention routine sends an attention code and message. Attention codes and attention messages can have any meaning that your application and the application at the remote connection end both recognize. The purpose of attention codes and messages is to allow clients of ADSP to send messages outside the normal data stream.

For example, if a connection end on a mainframe computer is connected to several connection ends in Macintosh computers being used as remote terminals, the mainframe computer might wish to inform the remote terminals that all connections will be terminated in ten minutes. The mainframe application could send an attention message to each of the remote terminals informing them of this fact, and the terminal emulation programs in the Macintosh computers could then display an alert message on the screen so that the users could prepare to shut down.

ASSEMBLY-LANGUAGE INFORMATION
To execute the dspAttention routine from assembly language, call the _Control trap macro with a value of dspAttention in the csCode field of the parameter block.

RESULT CODES
noErr0No error
errAttention-1276Attention message too long
errState-1278Connection is not open
errAborted-1279Request aborted by dspRemove or dspClose routine
errRefNum-1280Bad connection reference number

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996