Author Topic: Issue across multiple networks  (Read 3516 times)

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Issue across multiple networks
« on: April 22, 2015, 02:16:59 PM »
I can easily connect through LAN to computers on my network, but once I go somewhere else and try to connect to someone I have an issue connecting. It calls connect and then never fails nor completes. I have a lobby server set up on a remote computer (Digital Ocean).
I create a server locally when a player starts their game with some random game name and some port such as 7777.
  1. TNServerInstance.Start(tcpPort, 0, null, TNServerInstance.Type.Tcp, TNet.Tools.ResolveEndPoint(masterIP + ":" + masterPort), true);

Join code. ip and port are just grabbed from the Lobby Client known servers external address
  1. TNManager.Connect(ip, port);

I have no idea why I cannot connect. Do you have any tips?



thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Issue across multiple networks
« Reply #1 on: April 22, 2015, 02:22:02 PM »
I'm incorrect there was the error message "No connection could be made because the target machine actively refused it."

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue across multiple networks
« Reply #2 on: April 22, 2015, 02:40:39 PM »
It means the port is blocked.

All digital hosting services block all incoming ports by default unless you explicitly allow them through.

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Issue across multiple networks
« Reply #3 on: April 22, 2015, 03:04:25 PM »
The issue isn't with connecting to the lobby client in the cloud. I can register and unregister active games there without any issues. The issue is when I start a game server alongside the game and try to connect. Is there a step that I'm missing?

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Issue across multiple networks
« Reply #4 on: April 23, 2015, 08:23:00 AM »
I haven't tried actually going on my router and forwarding the port to this computer. I will try to do that today, but I assume it should work. Is there something I have to do with TNet to avoid having to forward ports?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue across multiple networks
« Reply #5 on: April 24, 2015, 08:00:07 AM »
TNet will open the port automatically only if it's able. It needs UPnP to be active and reachable on your router in order to do that. If not, you have to do it manually.

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Issue across multiple networks
« Reply #6 on: April 24, 2015, 08:55:33 AM »
I tried actually forwarding the port and still no luck. The LobbyClient server says the game is hosted on port 8888. I forward on my router port 8888 to the IP of the machine running the game and the server started in code. Then I try to connect from my machine on another network and it just gives me a "Unable to connect" error. Can we discuss via skype or something. I have a deadline that I really need this working by.

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Issue across multiple networks
« Reply #7 on: April 24, 2015, 08:58:39 AM »
Just to note, I am on TNet version 2.0.5

thenick191

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 25
    • View Profile
Re: Issue across multiple networks
« Reply #8 on: April 26, 2015, 09:40:07 AM »
So it turns out I figured out what my issue was. My modem was acting like a router and I had a router coming off of it. After restarting the modem it once again knows it's a modem and not a router and TNet can successfully open ports.