OpenSession
ASPOpenSession Initiate a workstation/server session
OSErr ASPOpenSession( xParamBlock, async); XPPParmBlkPtr xParamBlock; pointer to an AppleTalk parameter block Boolean async; 0=await completion; 1=immediate return ASPOpenSession initiates a session between a workstation and a server.
xParamBlock is a pointer to a parameter block structure. The relevant fields are
as follows:
¨ csCode short 2 26 AlwaysASPOpenSession
¨ sessRefnum short 2 28 Session reference number
¨ aspTimeout char 1 30 Retry interval in seconds
¨ aspRetry char 1 31 Number of retries
¨ scbPointer Ptr 4 36 Pointer to session control block ¨ attnRoutine Ptr 4 40 Pointer to attention routine async is a Boolean value. Use FALSE for normal ( synchronous) operation or TRUE to enqueue the request and resume control immediately. See Async I/O.
aspBadVersNum (-1066) Sever cannot support the offered version number
aspNoMoreSess (-1068) Driver cannot support another session
aspNo servers (-1069) No servers at that address, or the server did not
respond to the request
aspParamErr (-1070) Server returned bad (positive) error code
aspServerBusy (-1071) Server cannot open another session
reqAborted (-1105) OpenSess was aborted by an AbortOS
Notes: SessRefnum is a unique number identifying the open session between the
workstation and the server. The SessRefnum is returned when the function
completes successfully and is used in all calls to identify the session.
ASPTimeOut is the interval in seconds between retries of the open session
request.
ASPRetry is the number of retries that will be attempted.
ServerAddr is the network identifier or address of the socket on which the
server is listening.
SCBPointer points to a nonrelocatable block of data for the session control
block (SCB) that the .XPP driver reserves for use in maintaining an open
session. The SCB size is defined by the constant scbMemSize. The SCB is a
locked block and as long as the session is open, the SCB cannot be modified in
any way by the application. There is one SCB for each open session. This
block can be reused when an ASPCloseSession call is issued and completed
for that session, or when the session is indicated as closed through return of
aspParamErr as the result of a call for that session.
AttnRoutine is a pointer to a routine that is invoked if an attention from the
server is received, or upon session closing. If this pointer is equal to zero,
no attention routine will be invoked.
The number of sessions that the driver is capable of supporting depends on
the machine that the driver is running on.