Error while trying to connect to server.

I have been toying around with the Photon Server SDK and Unity for a few days now and have run into a problem. I have tried unitil now a number of settings and found out that when I try to connect to Photon using the local IP, it works just fine but when I try to connect to Photon using my computer's public IP, I get an error and a warning. The error is :
"Error trying to receive. Exception: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host."
And the warning is:
"Exception while connecting to: publicIP:port. Check if the server is available."
The server SDK is (probably set up okay). I use the LoadBalancing service with a MasterServer and a GameServer application. The GameServer application's public IP is set to my public IP. Thanks in advance!


  • Whoops. Nevermind. I fixed the problem. For those that also had this problem, for me the reason was that I messed up the ports in port forwarding. I had the UDP ports in the TCP space and the TCP ports in the UDP space.
  • Ouch!
    That would be hard to find from remote :)
    Glad you found it.