You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Server Module - EndSession Method
Terminate the session
Member of Server Module (PRIM_SRVM)

Details


The EndSession method is used to terminate the current session.
SrvRoutines defined with Session(*Required) will no longer be able to execute. Attempting to run one will result in the Failed event firing on the client.

Example


This example shows a simple session Server Module with routines for signing on and off.
A SessionIdentifier(PRIM_SRVM) is specified so that Server Module can be used in conjunction with other modules and can shared persisted data.
Begin_Com Role(*EXTENDS #PRIM_SRVM) SessionIdentifier(Personnel)
Define Field(#gUserID) Type(*Char) Length(40)
Persist Fields(#gUserID)
Srvroutine Name(Signin)
Field_Map For(*Input) Field(#User)
Field_Map For(*Output) Field(#Result)
If (#Com_owner.VerifyUser( #User ))
#Com_owner.StartSession Timeout(240)
#Result := OK
#gUserID := #User
Else
#Result := ER
Endif
Endroutine
Mthroutine Name(VerifyUser) Access(*Private)
Define_Map For(*Input) Class(#xDemoAlpha128) Name(#User)
Define_Map For(*Result) Class(#xDemoBoolean) Name(#Result)

  • No labels