[150722] in North American Network Operators' Group

home help back first fref pref prev next nref lref last post

Re: dns and software, was Re: Reliable Cloud host ?

daemon@ATHENA.MIT.EDU (Owen DeLong)
Thu Mar 1 17:43:50 2012

From: Owen DeLong <owen@delong.com>
In-Reply-To: <CAP-guGXLpzai4LrxyJcNn06yQ1jAEu4QeRpVzGRah=+OGLy9Zw@mail.gmail.com>
Date: Thu, 1 Mar 2012 14:37:07 -0800
To: William Herrin <bill@herrin.us>
Cc: Nanog <nanog@nanog.org>, Joe Greco <jgreco@ns.sol.net>
Errors-To: nanog-bounces+nanog.discuss=bloom-picayune.mit.edu@nanog.org

William,

I could have done it in a lot less lines of code, but, it would have =
been much less readable.

Not blocking on the connect() call is a little more complex, but, not =
terribly so. It does, however, again, make the code quite a bit less =
readable.

There are libraries available that abstract everything I did there and =
you are welcome to use them.

Since C does not support overloading, they export different functions =
for the behavior you seek.

If you want, program in Python where the libraries do provide the =
abstraction you seek. Of course, that means you have to cope with =
Python's other disgusting habits like spaces are meaningful and =
variables are indistinguishable from code, but, there's always a =
tradeoff.

You don't have to reinvent what I've done. Neither does every or any =
other application programmer.
You are welcome to use any of the many connection abstraction libraries =
that are available in open source. I suggest you make a trip through =
google code.

Owen

On Mar 1, 2012, at 2:09 PM, William Herrin wrote:

> On Thu, Mar 1, 2012 at 4:07 PM, Owen DeLong <owen@delong.com> wrote:
>> I think that the modern set of getaddrinfo and connect is actually =
not that complicated:
>=20
> Owen,
>=20
> If took you 50 lines of code to do
> 'socket=3Dconnect("www.google.com",80,TCP);' and you still managed to
> produce a version which, due to the timeout on dead addresses, is
> worthless for any kind of interactive program like a web browser. And
> because that code isn't found in a system library, every single
> application programmer has to write it all over again.
>=20
> I'm a fan of Rube Goldberg machines but that was ridiculous.
>=20
> Regards,
> Bill Herrin
>=20
>=20
>=20
>=20
>=20
> --=20
> William D. Herrin ................ herrin@dirtside.com  bill@herrin.us
> 3005 Crane Dr. ...................... Web: <http://bill.herrin.us/>
> Falls Church, VA 22042-3004



home help back first fref pref prev next nref lref last post