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 6 - AppleTalk Transaction Protocol (ATP) / ATP Reference
Routines / Responding to Requests


PAddResponse

The PAddResponse function sends an additional response packet to a socket that
has already been sent the first part of the response message through the PSendResponse function.

FUNCTION PAddResponse (thePBPtr: ATPPBPtr; async: Boolean): OSErr;
thePBPtr
A pointer to an ATP parameter block.
async
A Boolean that indicates whether the function should be executed asynchronously or synchronously. Specify TRUE for asynchronous execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe function result.
-->userDataLongIntFour bytes of user data.
-->csCodeIntegerAlways addResponse for this function.
-->atpSocketByteThe source socket number.
-->atpFlagsByteThe control information.
-->addrBlockAddrBlockThe destination socket address.
-->reqLengthIntegerThe size in bytes of the response data.
-->reqPointerPtrA pointer to the response data.
-->rspNumByteThe sequence number.
-->transIDIntegerThe transaction ID.

Field Description
userData
Four bytes of user data that are sent in the header of the message. You can use these bytes for any purpose that you wish.
atpSocket
The number of the socket that is used to send the additional response.
atpFlags
A control information field whose bits, numbered 0-7, are used
as flags.
To signal that this packet is the last packet in the transaction's response message when the number of responses is less than expected, set the end-of-message (atpEOMvalue) bit (bit 4).
ATP sets the send-transmission-status (atpSTSvalue) bit (bit 3) to force the requester to retransmit a request immediately, when this
is necessary.
To direct ATP to use DDP's checksum feature, set the send checksum (atpSendChkvalue) bit (bit 0) of this flag.
addrBlock
The number of the socket to which the additional response packet is to be sent.
reqLength
The size in bytes of the response data to be sent.
reqPointer
A pointer to the response data to be sent.
rspNum
The sequence number of the response, in the range of 0 to 7.
reqTID
The transaction ID of the request for which this response is meant.
DESCRIPTION
The PAddResponse function sends an additional response packet, following the initial response sent in return to a PSendResponse request message. You can send multiple additional response packets, one at a time, up to a total of eight packets including the initial response packets sent in the PSendResponse function.

You cannot issue a PAddResponse call without having first called PSendResponse. You must provide a pointer to the buffer containing the data to be sent and specify the amount of data. Each packet can contain up to 578 bytes of data. You also must specify the sequence number of the response.

SPECIAL CONSIDERATIONS
If the transaction is part of an exactly-once transaction, you must allocate nonrelocatable memory for the buffer that you use for the response data, and you must not alter the contents of this buffer until the corresponding PSendRequest function has completed execution.

ASSEMBLY-LANGUAGE INFORMATION
To execute the PAddResponse function from assembly language, call the _Control trap macro with a value of addResponse in the csCode field of the parameter block.
To execute this function from assembly language, you must also specify the .ATP driver reference number.

RESULT CODES
noErr0No error
badATPSkt-1099Bad responding socket
badBuffNum-1100Sequence number out of range
noSendResp-1103PAddResponse issued before PSendResponse
noDataArea-1104Too many outstanding ATP calls

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996