List Info

Thread: Re: does getaddrinfo() behave correctly?




Re: does getaddrinfo() behave correctly?
country flaguser name
Germany
2007-09-15 18:46:45
k.heinz.sep.siebenkh-22.de (Klaus Heinz) writes:

>in the course of building a package I discovered this
(IMO) strange
>behaviour of getaddrinfo() concerning port numbers:

>This does not:
>  $ ./test-getaddrinfo localhost 25  
>  result: 9 = servname not supported for ai_socktype


There is no way for getaddrinfo() to deduce a protocol
from just a port number.

Giving it a hint that you want data for a SOCK_STREAM is
enough and you get:

result: 0 = Success
flags: 0, family: 24, socktype: 1, protocol: 6

-- 
-- 
                                Michael van Elst
Internet: mlelstvserpens.de
                                "A potential Snark may
lurk in every tree."

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )