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


dspNewCID

The dspNewCID routine creates a connection ID to be used in setting up a connection.

You use the PBControl function to call the dspNewCID 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 dspNewCID for this function.
-->ccbRefNumIntegerThe CCB reference number.
<--newCIDIntegerThe ID of new connection.

Field Description
csCode
The routine selector, always equal to dspNewCID for this routine.
ccbRefNum
The connection control block (CCB) reference number that was returned by the dspNewCID routine for the connection end that
you want to use.
newCID
The connection-end ID that this routine returns. You must provide this number to the client of the remote connection end so that
it can use it for the remoteCID parameter when it calls the
dspOpen routine.
DESCRIPTION
The dspNewCID routine causes ADSP to assign an ID to a connection end without opening the connection end or attempting to establish a connection with a remote connection end. Use this routine only if you implement your own protocol to establish communication with a remote connection end. You must first use the dspInit routine to establish a connection end. Next, you must call the dspNewCID routine to obtain a connection-end ID. Then you must establish communication with a remote connection end and pass the ID to the remote connection end. Finally, you must call the dspOpen routine in ocEstablish mode to cause ADSP to open the connection.

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

RESULT CODES
noErr0No error
errState-1278Connection is not closed
errRefNum-1280Bad connection reference number
SEE ALSO
To establish a connection, use the dspInit routine, described on page 5-45.

To obtain a connection-end ID, use the sdspOpen routine, described on page 5-54.

To open a connection in ocEstablish mode, use the dspOpen routine, described on see page 5-48.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996