Hello everyone.
I have recently finished a Winsock Server, and a Winsock Client. The problem is, I do not know what type of a domain/and or server I would have to buy to be able to connect my Winsock Server, to it.
I already know that Winsock uses the inet_addr() function to define an IP address, which tells the server where to "listen" at; what I do not know, is how to go about "buying" an IP address that people can connect to.
Example:
What is preventing me from using google.com's IP address as the place for my server to "listen" at for connections?
What I have already tried, was to use a "free" web host service (000webhost.com). The service provided me with an IP address to my free website. I used that IP address in my Winsock Server; however, the application was unsuccessful to "bind" a socket to that IP address/port.
My winsock server was able to utilize
htonl (INADDR_ANY);
in order to connect two clients with each other (over MY home pc's IP address). However, when a remote IP address was used via the
inet_address()
, function, my program was unable to "bind" a socket to that IP address/port.
My question is, is it because the IP address was "free" that it could not be used to bind a socket to? Or, is it that I have be granted special privilidges by a Web Host providert to be able to use a specified IP address as a valid domain to connect to?
If I have to be granted special privilidges, what type of service would I have to buy? An ordinary website? Or, would I have to buy a dedicated server IP or something like that.