From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,b4758f11aa0ca2b5 X-Google-Attributes: gidf7344,public X-Google-Thread: f7cd1,b4758f11aa0ca2b5 X-Google-Attributes: gidf7cd1,public X-Google-Thread: 1164f8,b4758f11aa0ca2b5 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1993-05-25 08:28:59 PST Xref: gmd.de comp.sys.dec:7884 comp.os.vms:24090 vmsnet.misc:1251 Newsgroups: comp.sys.dec,comp.os.vms,vmsnet.misc Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!noc.near.net!uunet!olivea!decwrl!pa.dec.com!e2big.mko.dec.com!dbased.nuo.dec.com!adserv.enet.dec.com!winalski From: winalski@adserv.enet.dec.com (Paul S. Winalski) Subject: Re: Exec, Spawn, Objects in VMS Message-ID: <1993May25.152103.6262@dbased.nuo.dec.com> Sender: news@dbased.nuo.dec.com (USENET News System) Reply-To: winalski@adserv.enet.dec.com (Paul S. Winalski) Organization: Digital Equipment Corporation, Nashua NH X-Newsreader: mxrn 6.18-4 References: <1993May25.101807.8847@visionware.co.uk> Date: Tue, 25 May 1993 15:21:03 GMT In article <1993May25.101807.8847@visionware.co.uk>, chetanm@visionware.co.uk (Chetan Mistry) writes: |> |> Whats the best way to exec another program with another program. ? |>I have a DECnet object which listens for connections and then opens |>"SYS$NET" channel to read information about which server it has to fire off. |>The server program should use the same channel (ie. "SYS$NET") to talk to |>the remote program. This is not the way that DECnet-VAX is designed to operate. The way you're supposed to use it is to define a separate object for each server. The Unix inetd model is not the DECnet paradigm. In trying to do something like this, you're faced with two major problems: 1) One and only one I/O channel can be opened on SYS$NET:. All DECnet communications have to take place over that channel. In particular, a subprocess cannot access its parent's DECnet link. 2) Once you close SYS$NET:, the DECnet link is broken. This means that if you open SYS$NET: from within a program (i.e., in user mode), you cannot run another program in that process and have it talk over the DECnet channel (because I/O rundown of the first program will close the DECnet link). The easiest way around these difficulties is to open SYS$NET: for read and write access from DCL. Define your DECnet object to run a command procedure. Within the procedure, accept the logical link using a DCL OPEN statement: $ OPEN/READ/WRITE NETCHAN SYS$NET: You now have the DECnet link open as a process-permanent file, which means that it won't be closed upon exit of a user-mode program. You can now access it from within programs using logical name NETCHAN. Your program that reads the info about which server to fire off can then use LIB$RUN_PROGRAM to run the correct server. --PSW