Date: Fri, 1 Feb 2008 14:20:48 +0100 From: "Heiko Wundram (Beenic)" <wundram@beenic.net> To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= <des@des.no> Cc: freebsd-hackers@freebsd.org Subject: Re: OT: getting the protocol family of a file descriptor Message-ID: <200802011420.48350.wundram@beenic.net> In-Reply-To: <86bq70vn8b.fsf@ds4.des.no> References: <200801310923.16029.wundram@beenic.net> <200801311947.42545.wundram@beenic.net> <86bq70vn8b.fsf@ds4.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
Am Freitag, 1. Februar 2008 14:07:48 schrieb Dag-Erling Sm=C3=B8rgrav: > "Heiko Wundram (Beenic)" <wundram@beenic.net> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802011420.48350.wundram>