Important: The information in this document is obsolete and should not be used for new development.
POpenATPSkt
ThePOpenATPSktfunction opens a socket to be used to receive ATP requests or to be used to send ATP requests through thePNSendRequestfunction.
FUNCTION POpenATPSkt (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
 TRUEfor asynchronous execution.
--> ioCompletion ProcPtr A pointer to a completion routine. <-- ioResult OSErr The function result. --> csCode Integer Always openATPSktfor this function.<-> atpSocket Byte The socket number to be used. --> addrBlock AddrBlock The socket request specification. 
Field Description
atpSocket- The number of the socket that ATP is to open. To direct ATP to dynamically assign a socket number, which it returns as the value
 
of this field, specify 0.addrBlock- A value that specifies the AppleTalk internet socket addresses
 
that theatpSocketfield will receive requests from; specify 0 for the network number, the node ID, or the socket number to accept
all requests based on the value of that part of the AppleTalk internet socket address.DESCRIPTION
ThePOpenATPSktroutine serves two purposes: you use it to open a socket to be used for incoming requests, and you use it to open a socket to send requests using a specific socket. (ThePNSendRequestfunction lets you send a request using a specific socket, but you must first open that socket usingPOpenATPSkt.) You can use theaddrBlockfield to filter requests that you will accept by restricting network addresses.ASSEMBLY-LANGUAGE INFORMATION
To execute thePOpenATPSktfunction from assembly language, call the_Controltrap macro with a value ofopenATPSktin thecsCodefield of the parameter block. To execute this function from assembly language, you must also specify the .ATP driver reference number.RESULT CODES
noErr 0 No error tooManySkts -1098 Too many responding sockets noDataArea -1104 Too many outstanding ATP calls SEE ALSO
ThePNSendRequestfunction is described on page 6-27.