3.2. mtlock.bas

[<<<] [>>>]

This is a test program that has to executed in the Eszter SB Application Engine. This is useless being executed from the command line, and in addition being useless result extension specific error, because the CGI module can not handle the execution environment.

Start the Eszter SB Application Engine, configure it so that this program can be executed from some of the configured virtual directories and execute the program.

Note that the Eszter SB Application Engine has both the CGI and the MT modules statically linked so it has to work even if these modules are not installed on the machine.

Example mtlock.bas :

#!/usr/bin/scriba -c

' ' Call this program from several browsers and test locking and unlockings ' seeing how the different programs run and return an answer '

global const nl = "\n"

include cgi.bas include mt.bas

option cgi$Method cgi::Get or cgi::Upload

cgi::Header 200,"text/html"

cgi::FinishHeader

'------------------------------------------------------- print """<HTML> <HEAD> <title>MT module lock testing</title> </HEAD> <BODY><font face="VERDANA" size="2"> <H1>MT module lock testing</H1>

""" '-------------------------------------------------------

if isdefined(cgi::Param("lockw")) then mt::LockWrite cgi::Param("lockw") end if

if isdefined(cgi::Param("lockr")) then mt::LockRead cgi::Param("lockr") end if

if isdefined(cgi::Param("unlockw")) then mt::UnlockWrite cgi::Param("unlockw") end if

if isdefined(cgi::Param("unlockr")) then mt::UnlockRead cgi::Param("unlockr") end if

print """This is OK </BODY> </HTML> """


[<<<] [>>>]