[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 01316) Re: using getaddrinfo



On Sun, 17 Mar 2002, Noah Meyerhans wrote:
> The second parameter to getaddrinfo is a string that refers to a service
> listed in /etc/services.  What do I do if the port I am talking to may
> not be listed in /etc/services?  I have an integer that refers to the
> port, and nothing else.  I can pass NULL as the second parameter, but at
> some point I will have to specify the port in the ai_addr field of the
> return value.  What's the right way to do that?

#define PORT "1234"

and
        error = getaddrinfo(remote_host, PORT, &hints, &head);

?

-- 
Pekka Savola                 "Tell me of difficulties surmounted,
Netcore Oy                   not those you stumble over and fall"
Systems. Networks. Security.  -- Robert Jordan: A Crown of Swords