Re: C++, stdout, and XInetd

From: Joshua Kugler <jk@as.uaf.edu>
Date: Wed Apr 28 2004 - 23:22:57 AKDT

Well, I've figured it out, somewhat.

When the client disconnects, a SIGPIPE ends up getting sent to the server (the
program xinetd invoked). I tried setting up a handler in my program, but it
didn't seem to be getting invoked. So, I did a stripped down test program
(without any Qt stuff), and it *would* work. So, I have a message in to the
Qt mailing list asking why the Qt library is intercepting SIGPIPE.

Thanks for all your help everyone! I'll let you know what I find out.

j----- k-----

On Wednesday 28 April 2004 10:36 pm, Troy Melhase wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wednesday 28 April 2004 09:51 pm, Joshua Kugler wrote:
> > Well, I'm not using any special library, really. The way xinetd works is
> > that it connects stdin to the input stream and stdout to the output of
> > the program it invokes. So, I'm just using cout to print to the client.
>
> Okay, I think I understand what you're doing. But what I don't understand
> is this: which one of these endpoints, the "server" program or the socket
> client, is supposed to decide when the message or conversation or is
> complete?
>
> I think that answer, along with how you have the service configured in the
> xinetd.conf file will point to a solution. Is the service flagged as
> KEEPALIVE? I notice that man xinetd.conf says this:
>
> REUSE The REUSE flag is deprecated. All services
> now implicitly use the REUSE flag.
>
> > I'm using Qt, so I've even tried using a QFile and QIOStream and opening
> > stdout, but even when the client disconnects, QFile::isOpen() still
> > reports true. Very odd.
>
> I don't know how useful closing stdout would be. Can you shut the process
> down?
>
> - --
> Troy Melhase, troy@gci.net
> - --
> I am the Christian the Devil warned you about.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFAkKJjY7QSTRCBoM4RAicdAKC7CpE2GihP/SrTkxhFE6QRmqr3ywCffrMl
> CO+2yAtoEnCPG7V5g8He/10=
> =WyF8
> -----END PGP SIGNATURE-----
> ---------
> To unsubscribe, send email to <aklug-request@aklug.org>
> with 'unsubscribe' in the message body.

-- 
Joshua Kugler
Assistant Systems Administrator
UAF Department of Mathematical Sciences
UAF LUG President
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Wed Apr 28 23:23:17 2004

This archive was generated by hypermail 2.1.8 : Wed Apr 28 2004 - 23:23:19 AKDT