Hi ... i've just noticed something which has me a little confused.
I am working on a client/server program at the moment and i am calling WSAAsyncGetHostByName() to resolve the server address on the client.
But, when i give an IP address as the 3rd argument ... it still resolves the IP and connects fine ....
So, im wondering, why, if WSAAsyncGetHostByName can resolve an IP Address, winsock also has a function for this (WSAAsyncGetHostByAddr)
What's the difference between these two functions and should WSAAsyncGetHostByName() resolve an IP Address ?
Thanks in advance, Thunder :rolleyes:
I think you have missunderstood IP resolution. The only reason IP resolutions exist is to make people's life easier by not making them remember a buch of number, so they learn a word, which they can use to connect to the server. When you input an IP address, you don't need to resolve it, and the WSAAsyncGetHostByName() function probably has a defined behaviour for this.
To sum up, when you input an address, it resoves it, but when it gets an IP address, it bypasses the resloving, and fills the hostent structure like it had already resoved the name.
Thanks for your reply ... it makes sense now :o)
I just didn't actually think about it ... hehehe
thanks again :)