Click here to Skip to main content
Rate this: bad
good
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 10:20am

1 solution

Rate this: bad
good
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 'google.com' with HTTP port 80.
  Permalink  
Comments
Gbenbam at 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 at 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)

  Print Answers RSS
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 329
2 CPallini 270
3 Afzaal Ahmad Zeeshan 204
4 DamithSL 194
0 OriginalGriff 5,515
1 DamithSL 4,451
2 Maciej Los 3,902
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 23 Sep 2012
Copyright © CodeProject, 1999-2014
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