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 / Establishing and Terminating an ADSP Connection


dspOptions

The dspOptions routine allows you to set values for several parameters that affect
the behavior of the local connection end. You use the PBControl function to call the dspOptions 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 dspOptions for this function.
-->ccbRefNumIntegerThe CCB reference number.
-->sendBlockingIntegerThe send-blocking threshold.
-->badSeqMaxByteThe threshold to send retransmit advice.
-->useCheckSumByteA DDP checksum flag.

Field Description
csCode
The routine selector, always equal to dspOptions for this routine.
ccbRefNum
The connection control block (CCB) reference number that the dspInit routine returned.
sendBlocking
The maximum number of bytes that may accumulate in the send queue before ADSP sends a packet to the remote connection end. ADSP sends a packet before the maximum number of bytes accumulates if the period specified by the send timer expires, if
you execute the dspWrite routine with the flush parameter set
to 1, or if a connection event requires that the local connection end send an acknowledgment packet to the remote connection end.
You can set the sendBlocking parameter to any value from
1 byte to the maximum size of a packet (572 bytes). If you set the sendBlocking parameter to 0, the current value for this parameter is not changed. The default value for the sendBlocking parameter is 16 bytes.
badSeqMax
The maximum number of out-of-sequence data packets that the local connection end can receive before requesting the remote connection end to retransmit the missing data. Because a connection end does not acknowledge the receipt of a data packet received out of sequence, the retransmit timer of the remote connection end will expire eventually and the connection end will retransmit the data. The badSeqMax parameter allows you to cause the data to be retransmitted before the retransmit timer of the remote connection end has expired.
You can set the badSeqMax parameter to any value from 1 to 255.
If you set the badSeqMax parameter to 0, the current value for
this parameter is not changed. The default value for the badSeqMax parameter is 3.
useCheckSum
A flag specifying whether DDP should compute a checksum and include it in each packet that it sends to the remote connection end. Set this parameter to 1 if you want DDP to use checksums or to 0
if you do not want DDP to use checksums. The default value for useCheckSum is 0.
ADSP cannot include a checksum in a packet that has a short DDP header--that is, a packet being sent over LocalTalk to a remote socket that is on the same cable as the local socket. Note that the useCheckSum parameter affects only whether ADSP includes a checksum in a packet that it is sending. If ADSP receives a packet that includes a checksum, it validates the checksum regardless of the setting of the useCheckSum parameter.
DESCRIPTION
The dspOptions routine lets you set values that determine the behavior of a connection end, such as the blocking factor, which is maximum number of bytes that should accumulate in the connection end's send queue before ADSP sends a packet to the remote connection end, the maximum number of out-of-sequence packets received by the connection end before ADSP sends a request for the missing packets, and whether or not DDP should use checksums for all the packets that it transmits. You can set the options for any established connection end, whether or not the connection end is open.

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

RESULT CODES
noErr0No error
errRefNum-1280Bad connection reference number
SEE ALSO
Use the dspInit routine, described on page 5-45, to return the connection control block (CCB) reference number.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996