From owner-freebsd-hackers Mon Feb 27 00:32:15 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id AAA09609 for hackers-outgoing; Mon, 27 Feb 1995 00:32:15 -0800 Received: from tfs.com (mailhub.tfs.com [140.145.250.1]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id AAA09603 for ; Mon, 27 Feb 1995 00:32:14 -0800 Received: by tfs.com (smail3.1.28.1) Message-Id: From: julian@tfs.com (Julian Elischer) Subject: Re: pppd inactivity timeout? To: tom@haven.uniserve.com (Tom Samplonius) Date: Mon, 27 Feb 1995 00:30:58 -0800 (PST) Cc: hackers@FreeBSD.org In-Reply-To: from "Tom Samplonius" at Feb 26, 95 10:30:21 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1103 Sender: hackers-owner@FreeBSD.org Precedence: bulk >This will use a lot of cputime.. a better way would be to call timeout every 10 seconds or minute while the line is up, and have it decrement a counter.. if it reaches 0, you hang up. if not you just schedule another timeout.. whenever you receive or send a packet, you just set the counter back to initial condition (maximum count).. that way you're doing a single write, not a whole function call(x2) for each packet. julian > > I would like to add an inactivity timeout to pppd so that pppd would > hang-up after 10 minutes or so of inactivity on the line. The simplest > way I could find of doing this is to enable a new timeout using the > timeout() function provided to start enable the timeout, then use > back-to-back calls of untimeout() and timeout() to reset the timeout > value within the io() function. Anyways, I have two questions: > > - will it work? will it affect stability? > > - is there a better way of doing this? calling untimeout() and > timeout() upon every invocation of io() may induce alot of overhead... > > Comments are welcome... > > Tom >