Important: The information in this document is obsolete and should not be used for new development.
PPCInform
As long as a port has been opened, you can call thePPCInformfunction at any time. You can have any number of outstandingPPCInformfunctions.
FUNCTION PPCInform (pb: PPCInformPBPtr; async: Boolean): OSErr;
pb- A pointer to a
PPCInformparameter block.async- A value that specifies whether the function is to be executed asynchronously (
TRUE) or synchronously (FALSE). You should execute thePPCInformfunction asynchronously.
--> ioCompletion PPCCompProcPtr Address of a completion routine <-- ioResult OSErr Result code --> portRefNum PPCPortRefNum Port reference number of this session <-- sessRefNum PPCSessRefNum Session reference number of this session <-- serviceType PPCServiceType Service type of this session --> autoAccept Boolean If TRUE, session is accepted automatically--> portName PPCPortPtr Pointer to PPCPortRec, may beNIL--> locationName LocationNamePtr Pointer to LocationNameRec, may beNILuserName StringPtr Pointer to Str32, may beNIL<-- userData LongInt Application-specific data <-- requestType PPCSessionOrigin Network or local request DESCRIPTION
If your application calls thePPCInformfunction asynchronously, you must specify in theioCompletionfield either the address of a completion routine orNIL. If you setioCompletiontoNIL, you should poll theioResultfield 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 theioResultfield other than 1 indicates that the call is complete. Note that it is unsafe to poll theioResultfield 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.If you call the
PPCInformfunction asynchronously, you must not change any of the fields in the parameter block until the call completes. The port name, location name, user name, and buffer pointed to by the record of typePPCInformPBRecare owned by the PPC Toolbox until the call completes. These objects must not be deallocated or moved in memory while the call is in progress.You provide the PPC port identifier in the
portRefNumfield. APPCOpenfunction returns the port identifier. ThesessRefNumfield returns a session identifier.The
serviceTypefield indicates the service type. For system software version 7.0, this field always returns theppcServiceRealTimeconstant.If you set the
autoAcceptfield toTRUE, session requests are automatically accepted as they are received. When thePPCInformfunction completes execution with anoErrresult code and you set theautoAcceptfield toFALSE, you need to accept or reject the session.
The
- WARNING
- If the
PPCInformfunction (with theautoAcceptparameter set toFALSE) returns anoErrresult code, you must call either thePPCAcceptfunction or thePPCRejectfunction. The computer trying to initiate a session using theStartSecureSessionfunction or thePPCStartfunction waits (hangs) until the session attempt is either accepted or rejected, or until an error occurs.![]()
portNamefield must containNILor a pointer to a PPC port record. If theportNamefield containsNIL, then the name of the PPC port that initiated the session is not returned. If theportNamefield points to a PPC port record, then the PPC port record is filled with the name of the PPC port that initiated the session when thePPCInformfunction completes.The
locationNamefield must containNILor a pointer to a location name record. If thelocationNamefield containsNIL, then the location of the PPC port that initiated the session is not returned. If thelocationNamefield points to a location name record, then the location name record is filled with the location of the PPC port that initiated the session when thePPCInformfunction completes. If thelocationKindSelectorfield of the location name record returned isppcNoLocation, then the location is the local machine. If thelocationKindSelectorfield of the location name record returned isppcNBPLocation, then the location is a remote machine designated by the location name record'snbpEntityfield.The
userNamefield must containNILor a pointer to a 32-byte character string. If theuserNamefield containsNIL, then the user name string is not returned. If theuserNamefield points to a 32-byte character string, then the 32-byte character string is filled with the name of the user making the session request (if authenticated) when thePPCInformfunction completes.When the
PPCInformfunction completes, theuserDatafield contains the user data provided by the application making the session request. This field is transparent to the PPC Toolbox. The application can send any data in this field.When the
PPCInformfunction completes, therequestTypefield contains eitherppcRemoteOriginorppcLocalOrigin, depending on whether the session request is initiated by a computer across the network or by a port on the same computer.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePPCInformfunction are
Trap macro Selector _PPC $0003 The registers on entry and exit for this routine are
Registers on entry A0 Pointer to a parameter block D0 Selector code
Registers on exit D0 Result code RESULT CODES
noErr 0 No error notInitErr -900 PPC Toolbox has not been initialized yet noPortErr -903 Unable to open port or bad port reference number noGlobalsErr -904 System unable to allocate memory, critical error portClosedErr -916 The port was closed SEE ALSO
For an example of the use of thePPCInformfunction, see Listing 11-8 on page 11-36.