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: Interapplication Communication /
Chapter 11 - Program-to-Program Communications Toolbox / PPC Toolbox Reference
PPC Toolbox Routines / Opening and Closing a Port


PPCClose

You use the PPCClose function to close the port specified by the port reference number.

FUNCTION PPCClose (pb: PPCClosePBPtr; async: Boolean): OSErr; 
pb
A pointer to a PPCClose parameter block.
async
A value that specifies whether the function is to be executed asynchronously (TRUE) or synchronously (FALSE).
-->ioCompletionPPCCompProcPtrAddress of a completion routine
<--ioResultOSErrResult code
-->portRefNumPPCPortRefNumPort reference number of port to close

DESCRIPTION
If your application calls this function asynchronously, you must specify in the ioCompletion field either the address of a completion routine or NIL. If you set ioCompletion to NIL, you should poll the ioResult field of the PPC parameter block (from your application's main event loop) to determine whether the PPC Toolbox has completed the requested operation. A value in the ioResult field other than 1 indicates that the call is complete. Note that it is unsafe to poll the ioResult field at interrupt time since the PPC Toolbox may be in the process of completing a call. See "PPC Toolbox Calling Conventions" beginning on page 11-14 for detailed information.

The portRefNum field specifies the PPC port identifier of the port to close. The port reference number must be a valid port reference number returned from a previous call to the PPCOpen function.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the PPCClose function are
Trap macroSelector
_PPC$0009

The registers on entry and exit for this routine are
Registers on entry
A0Pointer to a parameter block
D0Selector code
Registers on exit
D0Result code

RESULT CODES
noErr0No error
notInitErr-900PPC Toolbox has not been initialized yet
noPortErr-903Bad port reference number
noGlobalsErr-904System unable to allocate memory, critical error
SEE ALSO
For an example of the use of the PPCClose function, see Listing 11-19 on page 11-44.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996