Author Topic: Unable to Join - target machine refused connection  (Read 1668 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Unable to Join - target machine refused connection
« on: May 31, 2015, 03:42:11 PM »
Forgive the beginner question! I'm trying the most basic setup where there's a single game session on a network. As such, I should be able to hard code the servers. I have a front end with a Host and Join button. The Host button runs

  1. public int serverTcpPort = 5127;
  2. string mAddress = "127.0.0.1";
  3.  
  4. If(!TNServerInstance.isActive){
  5.         TNServerInstance.Start(serverTcpPort, Random.Range(10000, 40000), "server.dat");
  6. }
  7.  
  8. TNManager.Connect(mAddress,serverTcpPort);
  9.  
I run that on one device. The Join button runs the same connect(mAddress,serverTcpPort). I press this on another device on the LAN and get the error that the machine refuses the connection.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Unable to Join - target machine refused connection
« Reply #1 on: June 01, 2015, 09:41:50 PM »
127.0.0.1 is a loopback address. It points to the same computer you are executing it on.

You need an actual LAN address, use ipconfig to figure it out. It's most commonly 192.168.1.X