Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Dark GDK with MultiSync

Author
Message
Rainbow Evil
14
Years of Service
User Offline
Joined: 31st Mar 2010
Location:
Posted: 20th Apr 2010 21:13
Hi,

I am using the MultiSync header file in DarkGDK and have got the hang of making a program which can communicate with another on the same computer by using the IP "127.0.0.1" but this IP doesn't work for online connection. I have tried using my IP which I got from http://www.ip-adress.com/ but that didn't work either for some reason. Here is my server code:

and here is my client code:

I know this isn't a very complex or probably even well written piece of code but I feel that is beside the point! The server successfully creates the game but the client gets stuck in the connect loop.

Thanks in advance

good things come to those who rate!

"I hate you all" - Simon Nicholls
r00tb00t
14
Years of Service
User Offline
Joined: 20th Apr 2010
Location:
Posted: 21st Apr 2010 00:28
To be honest, I don't understand your code but...

127.0.0.1 is a reserved IP address for use as a loopback address. 127.0.0.1 is yourself. Anyone who tries to connect to 127.0.0.1 will be connecting back to them selves which is why if you run both the client and server app's on your computer and get the client to connect to the server at IP address 127.0.0.1 it will connect back to the computer it is running on (yours) which is also where you are running the server from, hence the success of this trial.

To run this across a network you need two computers (obviously!) and you need to know the IP address of each. Also there maybe firewalls or routers in between which are blocking the connection. The same is true via The Internet. If say you want to play your game with me for example, if you had the server app and I had the client app then I would need to know your IP address (your suggestion of http://www.ip-adress.com/ would do just great) but you would need to set up port forward on your router (assuming you have one) and make the appropriate firewall changes (again, if you have one).

HTH.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 21st Apr 2010 13:57
well, if you want the client to connect to the server, when they are both running on your PC, or on your network, you should:
open command promt and type ipconfig, hit enter and search for Ipv4 or something like that, take that ip and host the server like this: NetHost_IP ( 2, theIP );, and now from the client, connect to the same IP.
if you want to connect to someone across the internet, you need to use the internet IP and forward your port, to be honest i dont know how to do this, and i dont quite know what it means, never tried it, as i cant access the router stuff in my country

good luck tho, you should except a good answer from benjamin ( that's his name right? ), he is multisync creator.

Rainbow Evil
14
Years of Service
User Offline
Joined: 31st Mar 2010
Location:
Posted: 22nd Apr 2010 01:01
Thanks both. I read something about port forwarding but don't fully understand what it does still! It would be good to hear from benjamin as I'm sure he has all the answers to this stuff and he has created a good piece of kit (although I read some good improvements which would be useful such as a vector-esque function to send and receive data so you can send custom objects without sending each part!) which is simple and easy to add to a project. Any more help on forward porting etc would be very useful and thanks again to the two previous posters.

good things come to those who rate!

"I hate you all" - Simon Nicholls
Rainbow Evil
14
Years of Service
User Offline
Joined: 31st Mar 2010
Location:
Posted: 23rd Apr 2010 03:21
I have now enabled port forwarding thanks to this great site which had a very detailed guide and contains absolutely loads of individual guides for each router! Doesn't seem to have any adverse effects (obviously doesn't affect internet as I'm replying ) and will proceed to try to make it work online

Hope this thread helps any others who encounter a similar problem.

good things come to those who rate!

"I hate you all" - Simon Nicholls

Login to post a reply

Server time is: 2024-11-20 01:46:58
Your offset time is: 2024-11-20 01:46:58