A 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.com2 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 PDT0 Organization: Kernel Mode Systems, San Diego, CA	 Lines: 48  To: Info-VAX@KL.SRI.COM  X-Gateway-Source-Info: USENET   N In article <1993May25.101807.8847@visionware.co.uk>, 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.    > Questions :-E > 1. If I use one of the 6 exec routines (execl, execvp, etc) will I  B > be able to reopen the "SYS$NET" channel from within the server??  L By your DECnet object listening for connections I presume you mean that it'sM assigned a channel to NET0:, declared its name, and is reading from a mailbox  associated with NET0:.    H If you are talking about one server receiving multiple inbound connects K (looks like you are), you don't use SYS$NET.  SYS$NET is a process-specific N logical name.  Newly-created network processes (target tasks) are created withO SYS$NET pointing to the DECnet logical link which they were created to service. L Subsequent attempts to create logical links to the same process have no way N of reaching into the process logical name table and defining a new equivalenceM name for SYS$NET.  (Well, actually this IS possible with special kernel ASTs, $ but anyway, DECnet doesn't do that.)  N Here's how it's supposed to go:  After getting a mailbox message indicating anL inbound connect attempt, you assign another channel to NET0: (which yields aL channel assigned to some other NETnnn: device), then issue a $QIO IO$_ACCESSM with a P2 argument containing the NCB which you read from the mailbox.  From  L then on IOs to this new channel are communicating with the new logical link.  M If you want the various "connections" to be served by different processes you N can certainly execxxx() or LIB$SPAWN another process, pass the NCB to it via aF mailbox or a job-wide logical name or whatever, and let it do the $QIO
 IO$_ACCESS.     H > 3. Is it possible to kill off the original object after it has started >    server   K If you mean kill off the process that was listening to the mailbox, yes, as L long as the process it creates (the server) isn't a subprocess.  (If it is, ' it'll die as soon as its creator dies.)   6 	--- Jamie Hanrahan, Kernel Mode Systems, San Diego CAO drivers, internals, networks, applications, and training for VMS and Windows NT N uucp 'g' protocol guru and release coordinator, VMSnet (DECUS uucp) W.G., and K Chair, Programming and Internals Working Group, U.S. DECUS VMS Systems SIG  B Internet:  jeh@cmkrnl.com  Uucp: uunet!cmkrnl!jeh  CIS: 74140,2055  