I''ve got a game setup so that the engine is running on one computer and the graphics are displayed on another. The "server" is actually just a hosting client that can''t be run as a real client and real client are clients that can''t be run as hosts.
It runs fine over a LAN but I can''t figure out why exactly I can''t conncet using an IP address over the net. I''m currently using ICQ to grab the IP address of the hosting computer from the client''s computer. I tried using the DNS number from winipcfg and that also didn''t work.
Any help would be great.
What sort of problem do you get? You simply cannot connect? I''m not sure how ICQ works but you may want to try using a couple API, there is an WinSock API (Maybe DirectX will have an equivalent check the docs) for returning the computers IP address. I''m not an absolute wiz at networking but I have a firend who is, if you could define the problem a bit more he might know the answer... Also are you running the internet THROUGH a lan? Cause then the server or server software might be masking/changing or relaying IP''s, which you might not be set up for, so you could be getting the IP of the actual computer when in reality you cannot contact that computer with that ip. For example with my high speed connection you are given one IP to use to connect to the internet so I use some server software which masks and then transfers service to other machines. I''m not sure how the IP''s all transfer to the internet though as the internally assigned IP''s are internal ONLY. You''ll probably have to use some API''s to get eachother''s IP''s.
Unfortunatly that is what I''m doing. The server is running on the main computer. When I get the IP from the host computer it''s the same as my client computer. When I put the IP address into a browser I get a homepage hosted by the service provider.
A couple things.. Especially if you''re not too familiar with tcp/ip..
(1) Is the host machine behind a firewall? This includes any kind of proxy. If you have an address for the server like 192.168.x.x then it won''t work; that''s a LAN address and doesn''t get forwarded by routers.
(2) Do you know the exact port number? If it''s a stream connection [ie, not datagrams] then can you TELNET to it? You should be able to at least connect. If the server has IP address 22.214.171.124 and the port is 7117, you can run TELNET like this:
C:\> TELNET 126.96.36.199 7117
Be sure you can connect before you tear any hair out over your own code!