< said:
> I guess this is a no-no then? It tries to match the protocol with
> the socktype.
Well, the specification appears to leave this possibility open. It
says:
# A value of zero for ai_socktype means that the caller shall accept
# any socket type.
So it is not illegitimate for the libra
< said:
> Shouldn't it do the mapping of addrhint.ai_protocol=6 (tcp)
> into ai_socktype = SOCK_STREAM?
No. In the socket model, the protocol is subordinate to the type of
socket. (For example, XNS SPP can implements both SOCK_SEQPACKET and
SOCK_STREAM.)
-GAWollman
To Unsubscribe: send mail
< said:
> What I mean is how would one map: localhost:http:tcp into that?
> There seems to be no way to determine what I must do to ai_socktype
> based on the above string.
Change the input format. The API was designed around the idea that
programs care about which socket model they get, not
< said:
> Using "our" APIs (getaddrinfo) is causing me much pain because I can't
> figure out how to map "tcp" -> SOCK_STREAM.
You don't. In the `hints' structure, you pass in ai_socktype ==
SOCK_STREAM. This is clearly documented in the manual page.
-GAWollman
To Unsubscribe: send mail to