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
Gbenbam988

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 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 186
4 Aajmot Sk 153
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.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