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 Listener


dspCLInit

The dspCLInit routine establishes and initializes a connection listener. You use the PBControl function to call the dspCLInit 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 dspCLInit for this function.
<--ccbRefNumIntegerThe CCB reference number.
-->ccbPtrTPCCBA pointer to CCB.
<->localSocketByteThe local DDP socket number.

Field Description
csCode
The routine selector, always equal to dspCLInit for this routine.
ccbRefNum
The connection control block (CCB) reference number. The dspCLInit routine returns this value.You must provide this number in all subsequent dspCLListen and dspCLRemove
calls to this connection listener.
ccbPtr
A pointer to the CCB that you allocated. The CCB is 242 bytes
in size.
localSocket
The number of the DDP socket that you want ADSP to use for this connection end. Specify 0 for this parameter to cause ADSP to assign the socket; in this case, ADSP returns the socket number when the dspCLInit routine completes execution.
DESCRIPTION
The dspCLInit routine establishes a connection listener; that is, it assigns a specific socket for use by ADSP and initializes the variables that ADSP uses to maintain a connection listener. The dspCLInit routine does not cause the connection listener
to listen for connection requests; you must follow the dspCLInit routine with the dspCLListen routine to activate the connection listener.

You must allocate a block of nonrelocatable memory for a CCB before you call the dspCLInit routine and pass a pointer to that CCB as the value of the ccbPtr parameter. See the section "Creating and Using a Connection Control Block" on page 5-12 and the section "The ADSP Connection Control Block Record" on page 5-35 for more information.

SPECIAL CONSIDERATIONS
The connection control block for which you allocate memory belongs to ADSP until you explicitly remove the connection listener. You cannot release the memory for the CCB until after you eliminate the connection listener.

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

RESULT CODES
noErr0No error
ddpSktErr-91Error opening socket
SEE ALSO
To establish a connection end that is not a connection listener, use the dspInit routine described on page 5-45.

To eliminate a connection listener, use the dspCLRemove routine, described on page 5-68.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996