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
Data Structures


The ADSP Connection Control Block Record

The connection control block (CCB) data structure is a record of type TRCCB 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, the userFlags 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:
 StateValueMeaning
 sListening1The socket is a connection listener--
that is, a socket that accepts ADSP requests to open connections and passes them on to a socket client. A connection listening socket passes
the open-connection request on to a routine that can establish the connec-
tion on any socket. The connection listening state is ordinarily used only by connection servers.
 sPassive2The socket client is inactive but capable of accepting an ADSP request to open
a connection. Unlike a connection listening socket, a socket client in the sPassive state can accept an open-
connection request only to establish itself as a connection end.
 sOpening3The socket client has sent an open-connection request and is waiting for acknowledgment.
 sOpen4The connection is open.
 sClosing5The socket client has requested that ADSP close the connection, and ADSP is sending data or waiting for acknowl-
edgment of data it has sent before closing the connection.
 sClosed6The connection is closed.
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 the userRoutine parameter to the dspInit routine (if any). The user routine must read the userFlags 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:
 EventFlag
bit
Meaning
 eClosed7ADSP has been informed by the remote connection end that the remote connection end has closed the connection.
 eTearDown6ADSP has determined that the remote connection end is not responding and so has closed the connection.
 eAttention5ADSP has received an attention message from the remote connection end.
 eFwdReset4ADSP has received a forward reset command from the remote connection end, has discarded all ADSP data not yet delivered--including the data in the local client end's receive queue--and has resynchronized the connection.
 None3-0Reserved.
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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996