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


dspCLListen

The dspCLListen routine causes a connection listener to listen for connection requests. You use the PBControl function to call the dspCLListen 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 dspCLListen for this function.
-->ccbRefNumIntegerThe CCB reference number.
<--remoteCIDIntegerThe ID of the remote connection end.
<--remoteAddressAddrBlockThe remote internet address.
-->filterAddressAddrBlockA filter for open-connection requests.
<--sendSeqLongIntThe initial send sequence number.
<--sendWindowIntegerThe initial size of the remote
receive queue.
<--attnSendSeqLongIntThe attention send sequence number.

Field Description
csCode
The routine selector, always dspCLListen for this routine.
ccbRefNum
The CCB reference number that the dspCLInit routine returned.
remoteCID
The identification number of the remote connection end. You must pass this value to the dspOpen routine when you open the connec-
tion or to the dspCLDeny routine when you deny the connection request. The dspCLListen routine returns this number.
remoteAddress
The internet address of the remote socket that sent a request to open a connection. This address consists of a 2-byte network number, a 1-byte node ID, and a 1-byte socket number. You must pass this value to the dspOpen routine when you open the connection or to the dspCLDeny routine when you deny the connection request.
filterAddress
The internet address of the socket from which you will accept a connection request. The address consists of three fields: a 2-byte network number, a 1-byte node ID, and a 1-byte socket number. Specify 0 for any of these fields for which you wish to impose no restrictions. If you specify a filter address of $00082500, for example, the connection listener accepts a connection request from any socket at node $25 of network $0008.
sendSeq
The sequence number of the first byte that the local connection end will send to the remote connection end. ADSP uses this number to coordinate communications and to check for errors. You must pass this value to the dspOpen routine when you open the connection.
sendWindow
The sequence number of the last byte that the remote connection end has buffer space to receive. ADSP uses this number to coordinate communications and to check for errors. You must pass this value to the dspOpen routine when you open the connection.
attnSendSeq
The sequence number of the next attention packet that the local connection end will transmit. ADSP uses this number to ensure that attention packets are delivered in the correct order and to check for errors. You must pass this value to the dspOpen routine when you open the connection.
DESCRIPTION
The dspCLListen routine initiates the connection listener. You must have already used the dspCLInit routine to establish a connection listener before using the dspCLListen routine. The dspCLListen routine is used only by connection servers.

When ADSP receives an open-connection request from a socket that satisfies the address requirements of the filterAddress parameter, it returns values for the remoteCID, remoteAddress, sendSeq, sendWindow, and attnSendSeq parameters and completes execution of the dspCLListen routine. You must then either accept the open-connection request by calling the dspOpen routine in the ocAccept mode or
deny the request by calling the dspCLDeny routine.

You can call the dspCLListen routine several times, specifying the same connection listener. For example, if you wanted to accept connections from any or all of three different addresses, you could call the dspCLListen routine three times with a different value for the filterAddress parameter each time. Note that you must execute the dspCLListen routine asynchronously to take advantage of this feature.

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

RESULT CODES
noErr0No error
errState-1278Not a connection listener
errAborted-1279Request aborted by the dspRemove routine
errRefNum-1280Bad connection reference number

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996