Date: Mon, 27 Feb 1995 00:30:58 -0800 (PST) From: julian@tfs.com (Julian Elischer) To: tom@haven.uniserve.com (Tom Samplonius) Cc: hackers@FreeBSD.org Subject: Re: pppd inactivity timeout? Message-ID: <m0rj0r4-0003vxC@TFS.COM> In-Reply-To: <Pine.BSF.3.91.950226222335.20527H-100000@haven.uniserve.com> from "Tom Samplonius" at Feb 26, 95 10:30:21 pm
next in thread | previous in thread | raw e-mail | index | archive | help
>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 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m0rj0r4-0003vxC>