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 / Opening and Closing an ATP Socket


POpenATPSkt

The POpenATPSkt function opens a socket to be used to receive ATP requests or to be used to send ATP requests through the PNSendRequest function.

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 TRUE for asynchronous execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe function result.
-->csCodeIntegerAlways openATPSkt for this function.
<->atpSocketByteThe socket number to be used.
-->addrBlockAddrBlockThe 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 the atpSocket field 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
The POpenATPSkt routine 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. (The PNSendRequest function lets you send a request using a specific socket, but you must first open that socket using POpenATPSkt.) You can use the addrBlock field to filter requests that you will accept by restricting network addresses.

ASSEMBLY-LANGUAGE INFORMATION
To execute the POpenATPSkt function from assembly language, call the _Control trap macro with a value of openATPSkt 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
tooManySkts-1098Too many responding sockets
noDataArea-1104Too many outstanding ATP calls
SEE ALSO
The PNSendRequest function is described on page 6-27.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996