Re: C++, stdout, and XInetd

From: Joshua Kugler <jk@as.uaf.edu>
Date: Wed Apr 28 2004 - 21:51:26 AKDT

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.

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.

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

On Wednesday 28 April 2004 08:40 pm, Troy Melhase wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wednesday 28 April 2004 06:28 pm, Joshua Kugler wrote:
> > I realize this is probably a sockets programming question, but I've
> > googled and experimented, and still can't come up with anything.
> >
> > I am using Xinetd to implement a simple C++ program that outputs data to
> > the client.
>
> Which C++ library are you using?
>
> That library should provide a notification if/when a client disconnects.
> If your library exposes the socket as if it were an io stream or file
> descriptor, there should be a method that you can call periodically to
> determine the state of its connection.
>
> (I'm extrapolating from experience with other languages that provide socket
> functionality; I don't have direct experience with C++ socket programming).

-- 
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 21:51:46 2004

This archive was generated by hypermail 2.1.8 : Wed Apr 28 2004 - 21:51:48 AKDT