Photon server sends DisconnectByServer

Options
sytyi
edited March 2012 in Photon Server
I have written a small test client with DB-based autorization and chat on Unity3d. It is working on local server, it is connecting to the server in the LAN as well.

The problem is next:

I've set up the Dynamical Dns link to my router, and I'm trying to connect using domain name;

I've forwarded 5055 port to the server.

When I am trying to connect to the server my client receives StatusCode.WaitingForConnection , server prints to the logs that an init request was received.

But it never gets connected, encryption is not established and I always receive StatusCode.DisconnectByServer.
Also server prints to log the message which is printed in OnDisconnect method

Any ideas?

Comments

  • dreamora
    Options
    if it works with localhost but not from the outside your configuration is likely wrong defining your external ip as 127.0.0.1, which will cause this.
  • sytyi
    Options
    I've tested it in LAN with LAN server

    Let my domain be example.ddns.com and server IP ve 192.168.0.10

    when I'm testing my client on 192.168.0.100 and connecting directly to 192.168.0.10:5055 it's working perfect

    but when i'm trying to connect using example.ddns.com:5055 the problem
    When I am trying to connect to the server my client receives StatusCode.WaitingForConnection , server prints to the logs that an init request was received.

    But it never gets connected, encryption is not established and I always receive StatusCode.DisconnectByServer.
    Also server prints to log the message which is printed in OnDisconnect method

    happens
  • dreamora
    Options
    I'm not 100% sure if defining the IP in the photonserver.config as example.ddns.com works by now. last time it was relevant to me it was limited to number tupples.
    But in the end thats what you need to have, the public IP of the machine if its meant to be reachable from the outside, so your best if not only hope is that example.ddns.com works if you don't want a static IP from your hoster or restart and reconfigure the machine every time the ip gets released by your ISP
  • sytyi
    Options
    Dynamic DNS works just like static IP.

    I use example.ddns.com as server adress on client side, what do you mean with the photonserver.config

    public IP is reachable, and my web page is accesible via Net so the problem is whether in using of not only 5055 port,
    or with sending reply from the server to client
  • dreamora
    Options
    What I mean is that if you use loadbalancing for example, you have to configure the external IP in GameServer1/bin and GameServer2/bin and I'm unsure that those will accept URLs beside IPs.
    If you are not routing through the external ip to the machine, you will also need to update the PhotonSocketServer config file in the deploy/Win_xx folder to point to the external IP as 0.0.0.0 will not work, it would detect the LAN IP, not the external IP and thus refuse to accept any connection as they are sent towards the external IP not the LAN internal one.

    if you use unity webplayer ensure that tcp 843 is reachable too by the way (security policy server)
  • Tobias
    Options
    "you have to configure the external IP in GameServer1/bin and GameServer2/bin and I'm unsure that those will accept URLs beside IPs."

    The gameserver config accepts hostnames but it will get the associated IP only on start. So if the master IP is dynamic and changes, the gameservers won't notice unless restarted. Afaik.