From owner-freebsd-hackers Wed Nov 6 13:26:32 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA26881 for hackers-outgoing; Wed, 6 Nov 1996 13:26:32 -0800 (PST) Received: from rah.star-gate.com (rah.star-gate.com [204.188.121.18]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA26875 for ; Wed, 6 Nov 1996 13:26:28 -0800 (PST) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.7.6/8.7.3) with ESMTP id NAA11085; Wed, 6 Nov 1996 13:25:01 -0800 (PST) Message-Id: <199611062125.NAA11085@rah.star-gate.com> X-Mailer: exmh version 1.6.9 8/22/96 To: Archie Cobbs cc: jgreco@brasil.moneng.mei.com (Joe Greco), hannibal@cyberstation.net, hackers@freebsd.org Subject: Re: Limiting bandwidth on a socket? (SO_RCVBUF?) In-reply-to: Your message of "Wed, 06 Nov 1996 12:46:15 PST." <199611062046.MAA08387@bubba.whistle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 06 Nov 1996 13:25:00 -0800 From: Amancio Hasty Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk What about kernel modifications? In a commercial environment it can be very beneficial to provide rate control. QOS --- that ugly old OSI term or more recently reservation bandwith services. Amancio >From The Desk Of Archie Cobbs : > > > > I'm trying to come up with some way to limit the amount of bandwidth on a > > > socket, so I can have my mail and large files retrieve without slowing > > > down a telnet session that much. > > > > > > [ ... ] > > > > > > Anyone know how to do this? > > > > int s, rval; > > > > s = socket(...); > > > > while ((rval = read(..., 1024)) > 0) { > > sleep(1); > > } > > > > if (rval < 0) { > > perror(...); > > } > > This also might be a good application for divert(4) sockets .. just > stick in a daemon that throttles the I/O on whatever connections you > want to throttle... basically, doing the same as above except your > exiting applications don't have to be modified. > > -Archie > > ___________________________________________________________________________ > Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com >