PPCOpenSync
PPCOpenPBPtr pb; Pointer to PPC parameter block
Boolean async; if TRUE, use asynchronous communications On entry A0: pointer to a parameter block
D0: selector (1)
On exit D0: result code
Parameter block
Æ 12 ioCompletion long address of a completion routine
¨ 38 portRefNum short port reference number of port opened
Æ 44 serviceType char service type requested-must be
Æ 45 resFlag char reserved field-must be 0
¨ 54 networkVisible long make this port network visible
¨ 55 nbpRegistered long port location was registered on network
The pb parameter should point to a PPC parameter block. The async
parameter is TRUE if the function is to be executed asynchronously. You open a port using the PPCOpen function and close a port using the If your application calls this function asynchronously, you must specify in
the ioCompletion field either the address of a completion routine or NIL. If
ioCompletion is 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.
If you call the PPCOpen function asynchronously, you must not change any of the fields in the parameter block until the call completes. The port name and
location name pointed to by the PPCOpen parameter block record are owned by
the PPC Toolbox until the call completes. These objects must not be de allocated or moved in memory while the call is in progress.
The portRefNum field returns the PPC port identifier. Use this
port reference number to initiate a session for this particular port. Set the
serviceType field to indicate that this port accepts sessions in real time. For
System 7.0 , this field must always be set to the ppcServiceRealTime constant.
You must set the resFlag field to 0.
The portName field must contain a pointer to a PPC port record that specifies
the name of the PPC port to be opened.
The locationName field should contain a pointer to a location name record that designates the location of the PPC port to be opened. If the locationName pointer
is NIL, then the default name PPC Toolbox is used. If a location name record is used, then the locationKindSelector field in the
location name record must be ppcNBPTypeLocation, and an
alias location name specified by the nbpType of the location name record field is used.
The networkVisible field indicates whether the port should be made visible (for browsing as well as incoming network requests). If you specify FALSE, this port is not visible in the listing of available ports across a network
(although it is still included within the local machine's listing of available
ports).
The nbpRegistered field returns TRUE if the location name specified was registered on the network.
noErr (0) No error
notInitErr (-900) PPC Toolbox has not been initialized yet nameTypeErr (-902) Invalid or inappropriate locationKindSelector in
location name
noPortErr (-903) Unable to open port
noGlobalsErr (-904) System unable to allocate memory, critical error
badReqErr (-909) Bad parameter or invalid state for this operation
portNameExistsErr (-910) Another port is already open with this name
badPortNameErr (-919) PPC port record is invalid
badServiceMethodErr (-930) Service method is other than ppcServiceRealTime
badLocNameErr (-931) Location name is invalid
nbpDuplicateName (-1027)Location name represents a duplicate on this computer