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


dspStatus

The dspStatus routine returns the number of bytes waiting to be read and sent and the amount of space available in the send and receive queues. You use the PBControl function to call the dspStatus 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 dspStatus for this function.
-->ccbRefNumIntegerThe CCB reference number.
<--statusCCBTPCCBA pointer to the CCB.
<--sendQPendingIntegerBytes waiting to be sent or acknowledged.
<--sendQFreeIntegerAvailable send queue in bytes.
<--recvQPendingIntegerBytes waiting to be read from queue.
<--recvQFreeIntegerAvailable receive queue in bytes.

Field Description
csCode
The routine selector, always dspStatus for this routine.
ccbRefNum
The connection control block (CCB) reference number that the dspInit routine returned.
statusCCB
A pointer to the CCB of the connection specified by the ccbRefNum parameter value.
sendQPending
The number of bytes of data that are in the send queue waiting to be sent, including 1 byte for each logical end-of-message (EOM) indicator in the send queue. (ADSP counts 1 byte for each EOM, even though no actual data corresponds to the EOM indicator.) The send queue contains all data that has been sent to ADSP for transmission and that has not yet been acknowledged. Some of the data in the send queue might have already been transmitted, but ADSP retains it in the send queue until the remote connection end acknowledges its receipt in case the data has to be retransmitted.
sendQFree
The number of bytes available in the send queue for additional data.
recvQPending
The number of bytes in the receive queue, including 1 byte for each EOM if the EOM bit is set in an ADSP packet header. The receive queue contains all of the data that has been received by the connection end but not yet read by the connection end's client.
recvQFree
The number of bytes available in the receive queue for
additional data.
DESCRIPTION
The dspStatus routine provides information about an open connection. In addition to returning the number of bytes waiting to be read and sent and the space available in the send and receive queues, this routine also returns a pointer to the CCB, which contains information about the state of the connection end and about connection events received by the connection end. For more information about the CCB, see "Creating and Using a Connection Control Block" on page 5-12 and "The ADSP Connection Control Block Record" beginning on page 5-35.

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

RESULT CODES
noErr0No error
errRefNum-1280Bad connection reference number

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996