SNAX Connection Manager (SNAX/CM) Manual
User Process Procedures
SNAX/CM Sample Server
C–14 097842 Tandem Computers Incorporated
END -- buffer is available
ELSE
BEGIN -- the thing is running, but we have no record
RETURN 0D;
END; -- the thing is running, but we have no record
END; -- WRITE of startup msg succeeded
END; -- OPEN succeeded
END; -- NEWPROCESS successful
RETURN 0D;
END; -- do^user1^connect
-------------------------------------------------------------------------------------------
-- DO^USERx^DISCONNECT Procedure
-- The "DISCONNECT" procedure is called when SXCMSV detects that a connection has been
-- terminated and a CONNECT^BUF was saved from a previous call to DO^USERx^CONNECT.
-- DO^USERx^DISCONNECT can then dispose of the application started previously in any
-- way the customer wants. In the provided examples, a created process is stopped using
-- the information saved in CONNECT^BUF (DO^USER1^DISCONNECT), or does nothing
-- (DO^USER2^DISCONNECT).
--
-- INPUTS: proc^buf - a structure in extended memory that holds the configured options
-- for the LU to be started. See SVUSERD for definition.
errmsg - A stack string buffer into which error message strings can be
-- placed before calling writeterm_ for display on the OUT file.
-- xpoolhead- The pool header for an extended memory pool.
--
-- OUTPUT: true - The application termination was successful.
-- false - The application termination failed.
-------------------------------------------------------------------------------------------
INT PROC do^user1^disconnect( connect^buf, errmsg, xpoolhead );
INT .EXT connect^buf( connected^buffer^template );
STRING .errmsg;
INT .xpoolhead;
BEGIN -- do^user1^disconnect
INT .proc^id[0:3];
STRING .proc^id^string := @proc^id '<<' 1;
proc^id^string ':='
connect^buf.base[ connect^buf.parm.offset ] FOR 8 BYTES;
CALL STOP ( proc^id );
RETURN true;
END; -- do^user1^disconnect
INT(32) PROC do^user2^connect( proc^buf, luexpname, errmsg, xpoolhead );
INT .EXT proc^buf( proc^buffer^template );
INT .luexpname;
STRING .errmsg;
INT .xpoolhead;
BEGIN -- do^user2^connect
LITERAL np^mem^size = 64, ! default newprocess values
np^pri = 144,
np^insp^off = 0,
np^insp^on = 1;
INT mem^size := np^mem^size,
pri := np^pri,
inspect^flags := np^insp^off;
INT procfn := -1;
INT .proc^id[0:3] := 4 * [" "];
STRING .proc^id^string := @proc^id '<<' 1;
STRING .temp^string[ 0:31 ];
INT lu^name^len;
INT .proc^name[0:11] := 12 * [" "];
INT .prog^file[0:11] := ["$SYSTEM SYSTEM RJECIS "];