apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <trawi...@bellsouth.net>
Subject Re: [PATCH] socket family fetching
Date Mon, 30 Apr 2001 21:58:30 GMT
Jon Travis <jtravis@p00p.org> writes:

> I need a routine to fetch the socket family.  I could just refer
> to the information in the sockaddr_t address length, but that is
> rather hackish.  Anyway, here tis.  We should also probably be
> moving towards making the sockaddr_t an opaque type, or at least
> some of the members.

I think that the better place to look is addr->sa.sin.sin_family.
Hopefully you should be able to return this as-is.

On first thought, the partial opaqueness makes sense (though I don't
know how to do that neatly in C).  Thinking down the road, the number
of accessor functions could get out of hand (similar to the
apr_fileinfo_t issue).  I'm mostly happy with apps peering into the
apr_sockaddr_t, though maybe we need to make it friendlier by adding
(e.g.) a family field which starts out as APR_UNSPEC and is set once
we know the family.

Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
             Born in Roswell... married an alien...

View raw message