ATPSndRequest
ATATPRecHandle abRecord; handle to an ATATPRec Boolean async; 0=await completion; 1=immediate return ATPSndRequest is part of the AppleTalk alternate interface. It is recommended that you use the preferred call, PSendRequest instead. abRecord is a handle to an ATATPRec structure. The relevant fields are as follows:
¨ abResult short 2 2 Result code
ÆabUserReference long 4 4 For your use
Æ atpAddress AddrBlock 4 10 Destination socket address Æ atpReqCount short 2 14 Length of datagram data or buffer size
Æ atpDataPtr Ptr 4 16 Pointer to buffer Æ atpRspBDSPtr BDSPtr 4 20 Pointer to response BDS Æ atpUserData long 4 30 User bytes
¨ atpEOM Boolean 2 35 End-of-message flag Æ atpTimeOut short 2 36 Retry timeout interval in seconds
Æ atpRetries short 2 38 Maximum number of retries
Æ atpNumBufs short 2 40 Number of elements in response BDS
¨ atpNumRsp short 2 42 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.
noErr (0) No error
reqFailed (-1096) SendRequest failed: retry count exceeded
tooManyReqs (-1097) Too many concurrent requests
noDataArea (-1104) Too many outstanding ATP calls
Notes: ATPSndRequest sends a request to another socket. ATPAddress is the internet address of the socket to which the request should be sent.
ATPDataPtr and atpReqCount specify the location and the size of a buffer
that contains the request information to be sent. ATPUserData contains the
user bytes for the ATP header.
ATPSndRequestrequires you to allocate a response BDS. ATPRspBDSPtr is a pointer to the response BDS; atpNumBufs indicates the number of
elements in the BDS (this is also the maximum number of response
datagrams that will be accepted). The number of response datagrams
actually received is returned in atpNumRsp; if a nonzero value is returned,
you can examine the response BDS to determine which packets of the
transaction were actually received. If the number returned is less than
requested, one of the following is true:
• Some of the packets have been lost and the retry count has been
exceeded.
• ATPEOM is TRUE; this means that the response consisted of fewer
packets than were expected, but that all packets sent were received
(the last packet came with the atpEOM flag set).
ATPTimeOut indicates the length of time that ATPSndRequest should wait for a response before retransmitting the request. ATPRetries indicates the
should be TRUE if you want the request to be part of an exactly-once
transaction.
ATPSndRequest completes when either the transaction is completed or the retry count is exceeded.