Subject: Re: Dumb/silly network programming question
To: #List NetBSD current users <current-users@NetBSD.ORG>
From: Christian Biere <>
List: current-users
Date: 12/06/2003 18:12:23
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Paul Goyette wrote:
> Since the session is using the TELNET protocol, I could just send an
> IAC NOP sequence, but that just seems so ugly!

Well, if you would just quit telnet (or whatever) normally instead of
using SIGKILL the socket should be close()d automatically and the
server would see that the connection was closed.

> I turned on SO_KEEPALIVE but it didn't timeout the session for at least
> 3 minutes - how can I reduce the timeout value for SO_KEEPALIVE?

I don't any portable way. Under NetBSD you can use sysctl(3) but that's
a system-wide limit setting. I'd rather use an appropriate timeout
value for select() and look for idle connections.


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)