OpenVMS Source Code Demos

overview:

  1. the server has high privs
  2. the client has low privs
  3. the client talks to the server through a memory structure known as a mail box, requesting that the server do some work on behalf of the client

Advocate DCL Scripts

Advocate_server_101_full_test.com

$!
$! advocate_server_101_full_test.com
$!
$	set on
$	say :== write sys$output
$	if f$trnlnm("CSMIS$ADVOCATE_CMD") .eqs. ""
$	then
$		say "-e- error, mail box logical CSMIS$ADVOCATE_CMD was not found"
$		goto fini
$	endif
$	open/write/error=open_error my_mbx_w CSMIS$ADVOCATE_CMD
$	open/read/error=open_error  my_mbx_r CSMIS$ADVOCATE_RSP
$!
$	cmd$ = "show time"
$	gosub send_to_mailbox
$	gosub send_to_mailbox
$	cmd$ = "this is a test"
$	gosub send_to_mailbox
$	cmd$ = "show queue yada"
$	gosub send_to_mailbox
$	cmd$ = "start/queue yada"
$	gosub send_to_mailbox
$	cmd$ = "stop/queue yada"
$	gosub send_to_mailbox
$	cmd$ = "delete/queue yada"
$	gosub send_to_mailbox
$	goto sortie
$!
$send_to_mailbox:
$	say "send>",cmd$
$	write my_mbx_w cmd$
$	my_buffer = "-e-timeout"
$	read/time_out=10  my_mbx_r my_buffer
$	say "resp>",my_buffer
$	return
$!
$open_error:
$	say "-e- mailbox open error"
$sortie:
$	set noon
$	close my_mbx_w
$	close my_mbx_r
$fini:
$	exit

Advocate_server_101_read-only_test.com

$!
$! advocate_server_101_read-only_test.com
$!
$	set on
$	say :== write sys$output
$	if f$trnlnm("CSMIS$ADVOCATE_CMD") .eqs. ""
$	then
$		say "-e- error, mail box logical CSMIS$ADVOCATE_CMD was not found"
$		goto fini
$	endif
$	open/read/error=open_error  my_mbx_r CSMIS$ADVOCATE_RSP
$!
$	cmd$ = "show time"
$	gosub send_to_mailbox
$	gosub send_to_mailbox
$	cmd$ = "this is a test"
$	gosub send_to_mailbox
$	cmd$ = "show queue yada"
$	gosub send_to_mailbox
$	cmd$ = "start/queue yada"
$	gosub send_to_mailbox
$	cmd$ = "stop/queue yada"
$	gosub send_to_mailbox
$	cmd$ = "delete/queue yada"
$	gosub send_to_mailbox
$	goto sortie
$!
$send_to_mailbox:
$!~~~	do nothing with cmd$
$	my_buffer = ""
$	read/time_out=5/error=time_out  my_mbx_r my_buffer
$	say "resp>",my_buffer
$	return
$time_out:
$	say "resp> -e- time out"
$	return
$!
$open_error:
$	say "-e- mailbox open error"
$sortie:
$	set noon
$	close my_mbx_w
$	close my_mbx_r
$fini:
$	exit

Back to OpenVMS
Back to Home
Neil Rieck
Kitchener - Waterloo - Cambridge, Ontario, Canada.