From owner-freebsd-hackers Fri Jul 28 14:51:19 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id E2F2037BC1A for ; Fri, 28 Jul 2000 14:51:13 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.3) id OAA27665; Fri, 28 Jul 2000 14:51:00 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200007282151.OAA27665@bubba.whistle.com> Subject: Re: a quick one In-Reply-To: from FengYue at "Jul 28, 2000 03:00:39 pm" To: FengYue Date: Fri, 28 Jul 2000 14:51:00 -0700 (PDT) Cc: freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG FengYue writes: > Hi there, a quick one. Is getpeername() considered expensive? > Would it be much better if I cache the result myself instead of > calling it everytime on the connected socket(returned from accept) to > find out which IP it connects to? It's not particularly expensive compared to other system calls.. but if you find system calls in general expensive, then it would certainly count as one :-) I'd say it's unlikely that this kind of optimization would be worth the trouble for a 'normal' application. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message