Click here to Skip to main content
12,894,200 members (65,591 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ Windows
Please can a domain name be passed to getaddrinfo winsock function?
This is the first time that I will be hosting a server end of a client/server application on the internet. I am used to passing computer names like MDComputer to getaddrinfo function. Now that I am about to host the application on the internet I wish to know if there is no problem with passing a domain name to getaddrinfo function.
Posted 23-Sep-12 9:20am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Yes you should be able to use getaddrinfo() to do the job on the internet. Lets try it for example with '' with HTTP port 80.
Gbenbam 23-Sep-12 15:52pm
I am sorry, I don't understand your response. Your tone suggest uncertainty. I feel it should be possible, but am not certain.
pasztorpisti 23-Sep-12 16:02pm
You have to use this to resolve internet addresses. Anyway, computer names work just like domain names in your local area network. Using hostnames/computer names in your local area network is a simplification: its much easier to refer to a machine like pc_katie then For your sake I just started my python interpereter and tried getaddrinfo() with '' with port 80 to check if you can use this as a test and it returned the list of addresses. Now you know the answer and you have test input to work with.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170424.1 | Last Updated 23 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100