A From:	SMTP%"winalski@adserv.enet.dec.com" 26-MAY-1993 08:28:28.62  To:	EVERHART CC:	% Subj:	Re: Exec, Spawn, Objects in VMS   2 X-Newsgroups: comp.sys.dec,comp.os.vms,vmsnet.misc5 From: winalski@adserv.enet.dec.com (Paul S. Winalski) ( Subject: Re: Exec, Spawn, Objects in VMS6 Message-Id: <1993May25.152103.6262@dbased.nuo.dec.com>	 Lines: 39 4 Sender: news@dbased.nuo.dec.com (USENET News System)9 Reply-To: winalski@adserv.enet.dec.com (Paul S. Winalski) 6 Organization: Digital Equipment Corporation, Nashua NH X-Newsreader: mxrn 6.18-4 # Date: Tue, 25 May 1993 15:21:03 GMT  To: Info-VAX@kl.sri.com  X-Gateway-Source-Info: USENET     4 In article <1993May25.101807.8847@visionware.co.uk>,0 chetanm@visionware.co.uk (Chetan Mistry) writes: |>E |>	Whats the best way to exec another program with another program. ? E |>I have a DECnet object which listens for connections and then opens N |>"SYS$NET" channel to read information about which server it has to fire off.K |>The server program should use the same channel (ie. "SYS$NET") to talk to  |>the remote program.   K This is not the way that DECnet-VAX is designed to operate.  The way you're L supposed to use it is to define a separate object for each server.  The Unix' inetd model is not the DECnet paradigm.   J In trying to do something like this, you're faced with two major problems:  F 1) One and only one I/O channel can be opened on SYS$NET:.  All DECnetI    communications have to take place over that channel.  In particular, a 5    subprocess cannot access its parent's DECnet link.   J 2) Once you close SYS$NET:, the DECnet link is broken.  This means that ifK    you open SYS$NET: from within a program (i.e., in user mode), you cannot G    run another program in that process and have it talk over the DECnet J    channel (because I/O rundown of the first program will close the DECnet	    link).   J The easiest way around these difficulties is to open SYS$NET: for read andM write access from DCL.  Define your DECnet object to run a command procedure. I Within the procedure, accept the logical link using a DCL OPEN statement:   # 	$ OPEN/READ/WRITE NETCHAN SYS$NET:   O You now have the DECnet link open as a process-permanent file, which means that K it won't be closed upon exit of a user-mode program.  You can now access it M from within programs using logical name NETCHAN.  Your program that reads the G info about which server to fire off can then use LIB$RUN_PROGRAM to run  the correct server.    --PSW   