[mythtv-users] Re: Why only numeric IP addresses work?

Michael J. Lynch mlynch at gcom.com
Wed Oct 13 15:33:56 UTC 2004

Joseph A. Caputo wrote:

>On Wednesday 13 October 2004 10:40, Grant Edwards wrote:
>>On Wed, Oct 13, 2004 at 08:51:42AM -0500, Grant Edwards wrote:
>>>and setting up an inet_addr stuct, all that's required is to
>>>rip out a couple dozen lines of code and replace it with a
>>>single call to gethostbyname().  That illustrates _my_ point:
>>>why would anybody go to all the extra work required to
>>>explicitly _not_allow_ hostnames?
>>I browsed around the source code a bit, and in some places
>>gethostbyname() is used (so the normal resover libraries will
>>work).  In other places, some Qt "host address" object is used.
>>>From what I can tell from the Qt documentation, that object can
>>only understand dotted-quad notation.  Apparently, the Qt guys
>>decided to write their own address parser rather than doing the
>>right thing and just calling gethostbyname().  Not only did
>>they reinvent the wheel, they apparently made it sqaure...
>Best guess is that they were trying to avoid having to deal with 
>variants of (or nonexistence of) gethostbyname() on different 
>platforms.  You have to make some compromises when you're developing a 
>cross-platform toolkit.
gethostbyname is implemented in the sockets library.  Any platform with 
a sockets
lib should have this function.  I've never seen a sockets lib that 
didn't have it.  Probably
the reason it's not being used is because it blocks and you really don't 
want that in
a GUI app.

>mythtv-users mailing list
>mythtv-users at mythtv.org

Michael J. Lynch

What if the hokey pokey IS what it's all about -- author unknown

More information about the mythtv-users mailing list