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 thePPCInform
function at any time. You can have any number of outstandingPPCInform
functions.
FUNCTION PPCInform (pb: PPCInformPBPtr; async: Boolean): OSErr;
pb
- A pointer to a
PPCInform
parameter block.async
- A value that specifies whether the function is to be executed asynchronously (
TRUE
) or synchronously (FALSE
). You should execute thePPCInform
function 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 beNIL
userName StringPtr Pointer to Str32
, may beNIL
<-- userData LongInt Application-specific data <-- requestType PPCSessionOrigin Network or local request DESCRIPTION
If your application calls thePPCInform
function asynchronously, you must specify in theioCompletion
field either the address of a completion routine orNIL
. If you setioCompletion
toNIL
, you should poll theioResult
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 theioResult
field other than 1 indicates that the call is complete. Note that it is unsafe to poll theioResult
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.If you call the
PPCInform
function 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 typePPCInformPBRec
are 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
portRefNum
field. APPCOpen
function returns the port identifier. ThesessRefNum
field returns a session identifier.The
serviceType
field indicates the service type. For system software version 7.0, this field always returns theppcServiceRealTime
constant.If you set the
autoAccept
field toTRUE
, session requests are automatically accepted as they are received. When thePPCInform
function completes execution with anoErr
result code and you set theautoAccept
field toFALSE
, you need to accept or reject the session.
The
- WARNING
- If the
PPCInform
function (with theautoAccept
parameter set toFALSE
) returns anoErr
result code, you must call either thePPCAccept
function or thePPCReject
function. The computer trying to initiate a session using theStartSecureSession
function or thePPCStart
function waits (hangs) until the session attempt is either accepted or rejected, or until an error occurs.portName
field must containNIL
or a pointer to a PPC port record. If theportName
field containsNIL
, then the name of the PPC port that initiated the session is not returned. If theportName
field 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 thePPCInform
function completes.The
locationName
field must containNIL
or a pointer to a location name record. If thelocationName
field containsNIL
, then the location of the PPC port that initiated the session is not returned. If thelocationName
field 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 thePPCInform
function completes. If thelocationKindSelector
field of the location name record returned isppcNoLocation
, then the location is the local machine. If thelocationKindSelector
field of the location name record returned isppcNBPLocation
, then the location is a remote machine designated by the location name record'snbpEntity
field.The
userName
field must containNIL
or a pointer to a 32-byte character string. If theuserName
field containsNIL
, then the user name string is not returned. If theuserName
field 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 thePPCInform
function completes.When the
PPCInform
function completes, theuserData
field 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
PPCInform
function completes, therequestType
field contains eitherppcRemoteOrigin
orppcLocalOrigin
, 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 thePPCInform
function 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 thePPCInform
function, see Listing 11-8 on page 11-36.