Important: The information in this document is obsolete and should not be used for new development.
The ADSP Connection Control Block Record
The connection control block (CCB) data structure is a record of typeTRCCB
that consists of 242 bytes. ADSP uses the CCB to store state information about the connection end. You allocate a nonrelocatable block of memory for this data structure when you create a connection end. You may read the fields in the CCB to obtain information about the connection end, but you are not allowed to write to any of the fields except one, theuserFlags
field.
TYPE TRCCB = PACKED RECORD ccbLink: TPCCB; {link to next CCB} refNum: Integer; {reference number} state: Integer; {state of the connection end} userFlags: Byte; {user flags for connection} localSocket: Byte; {local socket number} remoteAddress: AddrBlock; {remote end internet address} attnCode: Integer; {attention code received} attnSize: Integer; {size of attention data} attnPtr: Ptr; {pointer to attention data} reserved: PACKED ARRAY[1..220] OF Byte; {reserved for use by ADSP} END;
Field Description
ccbLink
- A pointer to the next CCB. This field is for use by ADSP only.
refNum
- The reference number of the CCB. This number is assigned by ADSP when you establish the connection end.
state
- The state of the connection end, as follows:
userFlags
- Flags that indicate an unsolicited connection event has occurred. An unsolicited connection event is an event initiated by ADSP or the remote connection end that is not in response to any ADSP routine that you executed.
- Each time an unsolicited connection event occurs, ADSP sets a flag in the
userFlags
field of the CCB and calls the routine you specified in theuserRoutine
parameter to thedspInit
routine (if any). The user routine must read theuserFlags
field and then clear the flag to 0. ADSP cannot notify your routine of future events unless you clear the flag after each event.- ADSP recognizes four types of unsolicited connection events, one corresponding to each of the flags in this field. The events and flags are defined as follows, where bit 7 is the most significant bit:
localSocket
- The socket number through which DDP transmits and receives the ADSP packets.
remoteAddress
- The AppleTalk internet address of the socket used by the remote connection end.
attnCode
- The attention code received by ADSP when the remote connection end sends an attention message.
attnSize
- The size of the attention message received by ADSP when the remote connection end sends an attention message.
attnPtr
- A pointer to a buffer containing the attention message received by ADSP from the remote connection end.
reserved
- A data buffer reserved for use by ADSP.