ATPGetRequest
ATPGetRequest Set up to receive a call
#include <AppleTalk.h> AppleTalk Manager
OSErr ATPGetRequest( abRecord, async);
ATATPRecHandle abRecord; handle to an ATATPRec
Boolean async; 0=await completion; 1=immediate return
returns Error Code; 0=no error
ATPGetRequest is part of the AppleTalk alternate interface. It is
recommended that you use the preferred call, PGetRequest instead.
ATPGetRequest sets up the mechanism to receive a request sent by either an
ATPSndRequest or an ATPRequest call.
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 tATPGetRequest
¨ abResult short 2 2 Result code
Æ abUserReference long 4 4 For your use
Æ atpSocket short 2 8 Listening socket number
Æ atpAddress AddrBlock 4 10 Source socket address
Æ atpReqCount short 2 14 Buffer size in bytes
Æ atpDataPtr Ptr 4 16 Pointer to buffer
¨ atpBitMap BitMapType 8 20 Transaction bit map
¨ atpTransID short 2 26 Transaction ID
¨ atpActCount short 2 28 Number of bytes actually received
Æ atpUserData long 4 30 User bytes
Æ atpXO Boolean 2 34 Exactly-once flag
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
sktClosedErr (-3109) Socket closed

Notes: ATPGetRequest sets up the mechanism to receive a request sent by either
an ATPSndRequest or an ATPRequest call. ATPSocket contains the
socket number of the socket that should listen for a request; this socket
must already have been opened by calling ATPOpenSocket. The address of
the socket from which the request was sent is returned in
atpAddress.ATPDataPtr specifies a buffer to store the incoming request;
atpReqCount indicates the size of the buffer in bytes. The number of bytes
actually received in the request is returned in atpActCount. ATPUserData
contains the user bytes from the ATP header. The transaction bit map is
returned in atpBitMap. The transaction ID is returned in atpTransID. ATPXO
will be TRUE if the request is part of an exactly-once transaction.
This routine completes when a request is received. To cancel asynchronous
calls, you can call call PKillGetReq You can also call ATPCloseSocket
but this cancels all pending calls involving that socket.