Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

Yes you should be able to use getaddrinfo() to do the job on the internet. Lets try it for example with 'google.com' with HTTP port 80.
 
Share this answer
 
Comments
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 pc_katie.internal.mycompany.com. For your sake I just started my python interpereter and tried getaddrinfo() with 'google.com' 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900