From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 1 13:19:32 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D4FB16A41A for ; Fri, 1 Feb 2008 13:19:32 +0000 (UTC) (envelope-from wundram@beenic.net) Received: from mail.beenic.net (mail.beenic.net [83.246.72.40]) by mx1.freebsd.org (Postfix) with ESMTP id 3209513C44B for ; Fri, 1 Feb 2008 13:19:32 +0000 (UTC) (envelope-from wundram@beenic.net) Received: from [192.168.1.38] (a89-182-8-185.net-htp.de [89.182.8.185]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.beenic.net (Postfix) with ESMTP id 431A7A44529; Fri, 1 Feb 2008 14:19:30 +0100 (CET) From: "Heiko Wundram (Beenic)" Organization: Beenic Networks GmbH To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Fri, 1 Feb 2008 14:20:48 +0100 User-Agent: KMail/1.9.7 References: <200801310923.16029.wundram@beenic.net> <200801311947.42545.wundram@beenic.net> <86bq70vn8b.fsf@ds4.des.no> In-Reply-To: <86bq70vn8b.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200802011420.48350.wundram@beenic.net> Cc: freebsd-hackers@freebsd.org Subject: Re: OT: getting the protocol family of a file descriptor X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2008 13:19:32 -0000 Am Freitag, 1. Februar 2008 14:07:48 schrieb Dag-Erling Sm=C3=B8rgrav: > "Heiko Wundram (Beenic)" writes: > > At the moment, there are two different kinds of connections being > > handled by front-end plugins (which basically accept on a listening > > socket, set up a certain initial state and pass it to the backend): > > AF_INET(6) and AF_BLUETOOTH. The latter won't work with the > > getaddr*-functions or getnameinfo() to format the address, > > so fix getnameinfo() :) > > > I personally don't find this especially beautiful > > why does it need to be beautiful? No, it doesn't need to be beautiful, of course. But when you use a language= =20 that has (slightly) higher type-safety than C, such as C++ (in the form of= =20 allowing you to cast pretty much anything to anything, but having to cast=20 _explicitly_ for pointers of different types except for conversion to void*= ),=20 you're bound to not understand your code after some time of letting it rest. And, it makes the code harder to read (at least if you stick to C++'s stand= ard=20 *_cast<>() templates) and debugging it more painful. That's what I'd call beautiful (as in "minimize the number of casts you=20 need"), but again, I already said that that it's okay if "it's just me." An= d=20 the actual "dirty" code is hidden away in a framework, anyway, so I hopeful= ly=20 won't have to touch that for quite some time. ;-) =2D-=20 Heiko Wundram Product & Application Development