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.

DarkBASIC Professional Discussion / DarkNET Internet Games

Author
Message
Rick the Programmer
22
Years of Service
User Offline
Joined: 23rd Mar 2004
Location: Maryland
Posted: 6th Jul 2013 19:49
Greetings.

I have been using Darknet for some LAN application with great success. I've been having trouble locating a proper tutorial for internet connections, particularly those using Darknet. I'm primarily looking to work on movement and event information for right now, but I'd rather have the code properly developed in an internet environment.

I tried entering my ip as given from whatsmyip.com and the connection didn't happen.

Using Darknet syntax, my Server Startup code is:


and my Client Startup Code is


Any info on what I might need to do differently to allow for internet connections would be greatly appreciated. I know I can comb through the Darknet syntax lists but I'm hoping some of you might have already been through the process and can guide me.

Thanks in advance

Ask not for whom the bell tolls;
It tolls for ye!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 6th Jul 2013 22:11 Edited at: 6th Jul 2013 22:12
If you're running them on the same computer at the same time, use the IP 127.0.0.1 (localhost) to connect to the server.

If you're running the two programs in a LAN (two separate computers), the internal IP address of the computer running the server is enough to connect to it.

If you're running them over the internet (two separate computers), things get more complicated. Basically, the port the server is using has to be open, or the client won't be able to connect. Just google port forwarding for more information, and you'll have to find out how to define what port the server is initialised on. You also have to make sure that the client is connecting to the external IP address, not an internal one.

TheComet

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th Jul 2013 11:29
I seem to recall that you actually have to set your real IP-address when setting up a server, because I remember I had to write a php script and access a webserver to retrieve it.
My network was a bit more complicated though and it's possible this was only needed when connecting two different servers running on the same machine to each other, but if 127.0.0.1 doesn't work in an internet environment it's worth trying. Also Windows 7 seems to resolve "localhost" to "0.0.0.0" (which is invalid) instead of "127.0.0.1" so don't use that


"Why do programmers get Halloween and Christmas mixed up?"
Sph!nx
17
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 8th Jul 2013 14:20
TheComet describes how I use it. Works fine.

Simply set the ports in the router (I base this upon my internal IP) and then when I ask clients to connect, they use my external IP.

Regards Sph!nx
www.mental-image.net

Login to post a reply

Server time is: 2026-07-07 04:32:41
Your offset time is: 2026-07-07 04:32:41