Author Topic: Unable to connect on different networks  (Read 3577 times)

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Unable to connect on different networks
« on: February 23, 2015, 03:19:06 PM »
I can connect fine on my local network. I have Tnet just connect using the local network IP. That works perfectly. I've tried going across networks and it's not working. I turned off firewalls and such too. I am using the internal external IP join method. Those are obtained from the lobby server and I verified that they are the correct IPs. Is there something else i should be aware of?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unable to connect on different networks
« Reply #1 on: February 24, 2015, 11:48:31 AM »
You need to connect by external IP, and make sure that it's actually reachable from the outside. Not all networks are accessible from the outside. Use an online port scan to see if your server is accessible. You can also open your address in the web browser (http://xxx.xxx.xxx.xxx:5127). If you get "no data received" it means the server is accessible. If you get "unable to connect" then it's not.

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Unable to connect on different networks
« Reply #2 on: February 25, 2015, 10:21:02 AM »
So I did that and if I use the local IP of the sever it says no data received which is good. I try the external IP and no such luck. The game creates a server while running for the player to use and others to join. Is the only option I have to forward the port on the router? Or is there something else you can recommend doing?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unable to connect on different networks
« Reply #3 on: February 27, 2015, 04:58:57 AM »
What do you pass to your TNServerInstance.Start when creating the server? Whether to have TNet open up a port is an optional parameter.

You can also see what happens by launching TNServer.exe -- it will tell you whether UPnP Gateway was reachable and the port was able to be opened.

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Unable to connect on different networks
« Reply #4 on: February 27, 2015, 08:21:18 AM »
  1. TNServerInstance.Start(27010, 0, null, TNServerInstance.Type.Tcp, TNet.Tools.ResolveEndPoint(lobbyServerIP + ":" + lobbyServerPort), true);

That's what I'm using to start it up.

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Unable to connect on different networks
« Reply #5 on: February 27, 2015, 08:25:18 AM »
I did just run the server exe and it turns out there's no gateway found. I guess that's the issue?

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Unable to connect on different networks
« Reply #6 on: February 27, 2015, 10:48:21 AM »
If I run the game from the Editor though and start a server I get the output "[TNet] UPnP Gateway: 192.168.1.1"
So I'm not sure exactly what the issue is now...I did check and verified that UPnP was enabled too.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unable to connect on different networks
« Reply #7 on: March 01, 2015, 05:17:54 PM »
Is your TNServer.exe actually up to date? The code used by TNet in the editor and the up-to-date version of TNServer is the same code. An older version of TNServer may not detect UPnP properly.

Also remember you can compile your own stand-alone TNServer with the solution files provided within a ZIP file inside the TNet's Assets folder.