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: Networking /
Chapter 8 - AppleTalk Session Protocol (ASP) / ASP Reference
Routines / Opening and Closing ASP Sessions


ASPCloseSession

The ASPCloseSession function closes the session that you identify.

FUNCTION ASPCloseSession (thePBptr: XPPParmBlkPtr;
                          async: Boolean): OSErr;
thePBptr
A pointer to an XPP parameter block.
async
A Boolean that specifies whether the function should be executed asynchronously or synchronously. Specify TRUE for asynchronous execution.
-->ioCompletionProcPtrA pointer to a completion routine.
<--ioResultOSErrThe function result.
-->ioRefNumIntegerThe .XPP driver reference number.
-->csCodeIntegerAlways closeSess for this function.
-->sessRefnumIntegerThe session reference number.

Field Description
sessRefnum
A unique number that the .XPP driver assigned to this session when you called the ASPOpenSession function to open the session.
DESCRIPTION
To close a single session, you pass the session's reference number to the ASPCloseSession function in the sessRefnum field. The session reference number
is the number that the .XPP driver assigns to the session and returns to you in the sessRefnum field when you open a session using the ASPOpenSession function. The ASPCloseSession function cancels any function calls that are pending for the session, closes the session, and calls the attention routine for the session, if there is one, with
an attention code of 0 to indicate that the session is closed.

Note that there are other ways in which a session can be closed: for example, ASP closes a session when one end of the session fails. A session remains open until it is explicitly terminated by either the ASP workstation application or the ASP server or until one of the session's ends fails or becomes unreachable.

SPECIAL CONSIDERATIONS
Note that you must provide the .XPP driver reference number as an input parameter
to this function. You can obtain the driver reference number by calling the Device Manager's OpenDriver function.

ASSEMBLY-LANGUAGE INFORMATION
To execute the ASPCloseSession function from assembly language, call the _Control trap macro with a value of closeSess in the csCode field of the parameter block. You must also specify the .XPP driver reference number. To execute the _Control trap asynchronously, include the value ,ASYNC in the operand field.

RESULT CODES
aspParamErr-1070You specified an invalid session reference number,
or the session has been closed
aspSessClosed-1072The .XPP driver is in the process of closing down
the session
SEE ALSO
You can call the ASPCloseAll function, described next, to cancel all active ASP sessions on your node. Note that you should use the ASPCloseAll function cautiously as applications and processes other than your own that are running on the same node could be using ASP sessions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996