Author Topic: Strange Connection Problem  (Read 2898 times)

caffeinepowered

  • Guest
Strange Connection Problem
« on: July 31, 2013, 05:42:57 PM »
Hello! I have been attempting to connect 2 clients together through TNet, and now I'm having a problem! No matter the way I attempt to connect, I always get the message "Unable to connect" in the console. I'm using port 54628, and have tried with 2 IPs. One thing that both IPs share is that the ISPs that provide them have problems with port forwarding, however I assumed that TNet wouldn't have trouble with that. I followed the tutorial in the docs perfectly(with NGUI! :D) and yet the only clue I ever get is "Unable to connect" when attempting to join a server. Occasionally when I start the server(through TNServerInstance.Start(54628)) I'll get the message "UPnP discovery failed". I honestly have no idea what's going on here!
Thanks for your help!
Bradley & Caffeine Powered Technologies

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Strange Connection Problem
« Reply #1 on: August 01, 2013, 02:22:29 PM »
UPnP message is harmless, just tells you that your router is either not reachable or doesn't have UPnP enabled (Apple routers don't support it, for example).

Quite a few routers also don't allow internal loopbacks -- that is, connecting to an external IP pointing to a local machine. For example if my local IP is 192.1.1.10 and external one is 24.24.24.24, and I have one of those routers, then I won't be able to connect to myself using 24.24.24.24, but will be able to using 192.1.1.10 and 127.0.0.1.

You'll need to provide some more information as to how you are connecting, where the server is hosted, and what IP you're using.

caffeinepowered

  • Guest
Re: Strange Connection Problem
« Reply #2 on: August 01, 2013, 02:34:14 PM »
Ah, I'm fairly certain my "router" has UPnP. The server I attempt to connect to is in Canada and I'm using the public IP. I'm in southern US, on an ATT Unite 4G LTE modem due to area internet restraints. I can connect to my localhost by hosting the server and joining my PC's network IP, but I doubt if that helps.. The server is running Windows 7 Professional Edition, and I'm connecting with Windows 8 Pro. If you need my IP or my server's IP, I'd prefer to do that through a more private medium like PM or Skype :)On thing that's strang about both of our IPs is that they're not standard type.. For example my public IP as reported by Google and WhatismyIP.com is 166.xxx.xxx.xxx and the server is wierd like that as well. I'm connecting through TNManager.Connect("xxx.xxx.xxx", 54628); Thanks again!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Strange Connection Problem
« Reply #3 on: August 01, 2013, 02:46:16 PM »
You can check to see if the server is reachable by using a web browser. Connect to your server like so:

http://166.xxx.xxx.xxx:54628

You will get a "No data received" message in Chrome if the server is accessible.

caffeinepowered

  • Guest
Re: Strange Connection Problem
« Reply #4 on: August 01, 2013, 02:51:17 PM »
Chrome just says "Could Not Connect to 166.xxx.xxx.xxx:54628" unfortunately. Would you like me to strip my project and send it to you? It's probably just my ISP being stubborn though.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Strange Connection Problem
« Reply #5 on: August 01, 2013, 02:52:01 PM »
Then your server is simply not reachable. Did you open a port there? Can others reach it?

caffeinepowered

  • Guest
Re: Strange Connection Problem
« Reply #6 on: August 01, 2013, 03:15:49 PM »
I have no way to tell if others can use it at the moment unfortunately. By open a port do you mean portforwarding? EDIT: Just tested on somebody else's computer, same result.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Strange Connection Problem
« Reply #7 on: August 01, 2013, 05:33:57 PM »
When you simply host a server, it must be done either on a public-accessible computer, or you need to set up port forwarding on the router that's in between your server and the internet.

caffeinepowered

  • Guest
Re: Strange Connection Problem
« Reply #8 on: August 01, 2013, 05:36:53 PM »
Oh noes! Neither of our ISPs are friendly to portforwarding. I thought I had read somewhere that TNet handles that stuff without going through conventional means. Oh well. Could Hamachi work?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Strange Connection Problem
« Reply #9 on: August 01, 2013, 10:22:09 PM »
TNet opens the port using UPnP if it's available and enabled (as is the case with most home routers), but it can't do anything if it's not. Hamachi is a tunneling app that creates virtual networks, so I'm not sure how it would apply here. You just need a port opened.