Author Topic: Others connect to me, but can't connect out  (Read 1444 times)

MarioMush

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Others connect to me, but can't connect out
« on: November 07, 2013, 11:57:05 AM »
Hey there fellow TNet users,

I made myself a connection example of simply starting a server, connecting/disconnecting etc, and it all works fine if I run two instances of it on my computer.

It all connects fine, I see the players in the channel.

When I sent the example to people to test this over internet, I found that they can connect to me just fine, however I couldn't connect to any of them. I also find that if I use a server tcp port other than 5127, it wont allow me to connect, even if its own my own computer.

Is this because I have a problem with my firewall/router? I hope it is so I know there's nothing wrong with what I've done, as the code shouldn't be wrong as I've looked it over.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Others connect to me, but can't connect out
« Reply #1 on: November 08, 2013, 11:12:25 AM »
TNet tries to open up a port itself using UPnP, but that functionality may not always be available. Apple Failport Extreme series of routers don't support UPnP for example. You can tell if a port is open or not by running TNServer.exe. By default it will open up ports 5127 and 5128, but you can use it with additional parameters to open other ports. Likewise you can do it from Unity via code by using the UPnP class itself. That's what TNet does when you host a server.