From: SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM" 25-MAY-1993 18:03:29.29 To: EVERHART CC: Subj: Re: Exec, Spawn, Objects in VMS From: jeh@cmkrnl.com X-Newsgroups: comp.sys.dec,comp.os.vms,vmsnet.misc Subject: Re: Exec, Spawn, Objects in VMS Message-ID: <1993May25.091209.2060@cmkrnl.com> Date: 25 May 93 09:12:09 PDT Organization: Kernel Mode Systems, San Diego, CA Lines: 48 To: Info-VAX@KL.SRI.COM X-Gateway-Source-Info: USENET 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. > Questions :- > 1. If I use one of the 6 exec routines (execl, execvp, etc) will I > be able to reopen the "SYS$NET" channel from within the server?? By your DECnet object listening for connections I presume you mean that it's assigned a channel to NET0:, declared its name, and is reading from a mailbox associated with NET0:. If you are talking about one server receiving multiple inbound connects (looks like you are), you don't use SYS$NET. SYS$NET is a process-specific logical name. Newly-created network processes (target tasks) are created with SYS$NET pointing to the DECnet logical link which they were created to service. Subsequent attempts to create logical links to the same process have no way of reaching into the process logical name table and defining a new equivalence name for SYS$NET. (Well, actually this IS possible with special kernel ASTs, but anyway, DECnet doesn't do that.) Here's how it's supposed to go: After getting a mailbox message indicating an inbound connect attempt, you assign another channel to NET0: (which yields a channel assigned to some other NETnnn: device), then issue a $QIO IO$_ACCESS with a P2 argument containing the NCB which you read from the mailbox. From then on IOs to this new channel are communicating with the new logical link. If you want the various "connections" to be served by different processes you can certainly execxxx() or LIB$SPAWN another process, pass the NCB to it via a mailbox or a job-wide logical name or whatever, and let it do the $QIO IO$_ACCESS. > 3. Is it possible to kill off the original object after it has started > server If you mean kill off the process that was listening to the mailbox, yes, as long as the process it creates (the server) isn't a subprocess. (If it is, it'll die as soon as its creator dies.) --- Jamie Hanrahan, Kernel Mode Systems, San Diego CA drivers, internals, networks, applications, and training for VMS and Windows NT uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and Chair, Programming and Internals Working Group, U.S. DECUS VMS Systems SIG Internet: jeh@cmkrnl.com Uucp: uunet!cmkrnl!jeh CIS: 74140,2055