TCP still working?

Blitz3D Forums/Blitz3D Beginners Area/TCP still working?

Fey(Posted 2010) [#1]
Hi! I've been working on this for 2 days now, and have made exhaustive use of the code archives and search function. You all have made many great tutorials, but I'm wondering...

I've been able to make clients that can connect to the server but only on my local machine using the address 'localhost' or '127.0.0.1'

Whenever I type in my public IP address the code never works. At first I thought maybe it was just a firewall issue or something simple, so I messed around with my settings. A few minutes ago I even loaded a few games (like Quake 3) and had a friend of mine in another state join my game using ip address just to make sure things were set up right, and he was able to connect.

So are the CreateTCPServer, AcceptTCPStream, and OpenTCPStream commands no longer working over the internet? I use Windows 7, and would be happy to answer any other questions that might lead to a fix to this.

I can post the code I'm using right now to if this would help anyone.

I'm terribly confused and never was very good with network code anyway -_-

Thanks for any help! <3

EDIT: I notice that the description for CreateTCPServer says to use it to communicate "between other clients and the local box", but many of the tutorials I've read said it can work over the internet. Confused :)


GfK(Posted 2010) [#2]
It can work... but the problem is that you need to decide which port you're going to use, and set your router up to forward requests on that port to your LAN IP address. How you do that, varies from one router to another.


Fey(Posted 2010) [#3]
I actually intentionally looked up the port that several other games were using that were not having problems (Quake 3, again as an example, was port 27960) and didn't find that had any impact.

Originally I had just made up something (7000) and have tried lots of things including 80 (since there's an example that works correctly as a client that uses 80) but haven't gotten anything to work as a server.

That is to say, nothing made with blitz has worked as a server. Other programs I've tested to make sure I wasn't having a problem with my hardware or firewalls all work fine.

So I'm not sure how to further verify that the port isn't the problem >_>

Then again I not even 100% sure I actually understood your answer, lol, so I'll keep working with it. Maybe I'll find something in the router's manual.


Fey(Posted 2010) [#4]
Does anyone know why one program would require a router be set up special to get to an IP/Port combination but several totally different programs don't require any special effort?

Also, should I just look into UDP, does it bypass any of these problems? I've only ever worked with TCP before in other languages.

Thanks <3


stanrol(Posted 2010) [#5]
TCP rocks.


xlsior(Posted 2010) [#6]
Stanrol:

Your signature really is way to big, you may want to trim it down a bit.

From the forum FAQ: http://www.blitzbasic.com/faq/faq_entry.php?id=10

What is the acceptable size of signatures?

As a general guideline you should use *either* five lines of text or an image no taller than 80 pixels.




xtremegamr(Posted 2010) [#7]
@stanrol: Umm...I'm not quite sure how that helps.

@Fey: I don't think UDP will bypass any of the problems you're having; your problem doesn't seem protocol-related. Instead, try running the game using your LAN -- if you can connect and play, you know it's a problem with your router\firewall.