ATPResponse
ATPResponse Send a response packet
#include <AppleTalk.h> AppleTalk Manager
OSErr ATPResponse(abRecord , async);
ATATPRecHandle abRecord; handle to an ATATPRec
Boolean async ; 0=await completion; 1=immediate return
returns Error Code; 0=no error
ATPResponse is part of the AppleTalk alternate interface. It is
recommended that you use the preferred call, PSendResponse instead.
ATPResponse sends a response packet to another socket.
abRecord is a handle to an ATATPRec structure. The relevant fields are as
follows:
Out-InName Type Size Offset Description
¨ abOpcode ABCallType 1 0 Always tATPResponse
¨ abResult short 2 2 Result code
Æ abUserReference long 2 4 For your use
Æ atpSocket short 2 0 Responding socket number
Æ atpAddress AddrBlock 4 2 Destination socket address
Æ atpTransID short 2 24 Transaction ID
Æ atpRspUData long 4 46 User bytes received in response
Æ atpRspBuf Ptr 4 50 Number of elements in responseBDS
Æ atpRspSize short 2 54 Number of response packets received
async is a Boolean value. Use FALSE for normal ( synchronous) operation
or TRUE to enqueue the request and resume control immediately. See
Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
badATPSkt (-1099) Bad ATP-responding socket
noRelErr (-1101) No release received
noDataArea (-1104) Too many outstanding ATP calls
atpLenErr (-3106) Length error
sktClosedErr (-3109) Socket closed

Notes: ATPResponseis functionally analogous to ATPSndRsp. It sends a
response to another socket, but does not require the caller to provide a BDS.
ATPAddress must contain the complete network address of the socket to
which the response should be sent (taken from the data provided by an
ATPGetRequest call) ATPTransID must contain the transaction ID.
ATPSocket indicates the socket from which the response should be sent (the
socket on which the corresponding ATPGetRequest was issued).
ATPRspBuf points to the buffer containing the response message; the size
of this buffer must be passed in atpRspSize. The four user bytes to be sent
in the ATP header of the first response packet are passed in atpRspUData.
The last packet of the transaction response is sent with the EOM flag set.
Although you do not provide a BDS, ATPResponse in fact creates one and
calls the .ATP driver (as in an ATPSndRsp). For this reason, the abRecord
fields atpRspBDSPtr and atpNumBfs are used by ATPResponse; you should
not expect these fields to remain unaltered during or after the function's
execution.
During exactly-once transactions ATPResponse will not complete until
the release packet is received or the release time expires.
Warning: The maximum permissible size of the response message is
4624 bytes.