HP3000-L Archives

November 1998, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Date:
Wed, 25 Nov 1998 16:21:40 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
alan fay writes:
> If I set up a tcp/ip service on a port with inetd
> & services when I get a connection I can read stdin
> but cannot write to stdout (or stdin) how do I send
> something to the connecting machine thru the
> connect socket?
>
> I can do this (and am currently) with a standalone
> listen/accept but I am trying to make it a proper
> inetd service.

MPE inetd is broken in that it only passes the socket descriptor as stdin fd 0.
It improperly sets up stdout fd 1 as the JINETD job's $STDLIST.  Note that
stderr fd 2 is properly set up as the job's $STDLIST.

If you want to also have the socket on stdout, you should be able to simply:

        dup2(STDIN_FILENO, STDOUT_FILENO);
--
Mark Bixby                      E-mail: [log in to unmask]
Coast Community College Dist.   Web: http://www.cccd.edu/~markb/
District Information Services   1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support               Voice: +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)

ATOM RSS1 RSS2