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)