On premise (self-hosted server) timeouts

Options
Hello,

Let me start by saying I'm a newbie to networking using Photon, and I've never used Unity's UNET either. I have some experience using Unity's low-level TCP and UDP networking.

I am using Photon PUN 2 alongside a Photon server SDK ver 4.0.28.2962 (100 CCU free tier). I went through the Photon 2 tutorials and wrote scripts and setup my Unity project the way the tutorials suggested. When using Photon's servers, I am successfully able to run both my scenes/scripts, as well as Photon's built-in examples (e.g., PunBasics - Launcher). However, when I changed the server to my locally hosted Photon server, neither my own scenes nor Photon's sample scenes work. When I enabled Network logging, I see timeouts followed by disconnects.

I set up my server using the famous 5-minute video from photonengine.com, and also some YouTube videos. No matter what options I provide for 'Server' and 'Port' entries in PhotonServerSettings, I am unable to network connect and run either my own app or PUN2 sample scenes. When installing Photon SDK, the installer prompted for an admin password, so I am assuming Photon's reserved port numbers are made available (I haven't checked).

Here is a screenshot of my console output, and my Photon server settings.
1. https://www.dropbox.com/s/sykmt76n6h85t79/PhotonServerSettings.png?dl=0
2. https://www.dropbox.com/s/o0hreml48tu0ra9/SelfHostedServerTimeoutMessages.png?dl=0

The interesting thing is that when I set a port # to 0 or any other number, my console output would always show that it is connecting to MyLocalIPAddress:5058. I do not remember hardcoding this port number anywhere either in my scripts or in Photon server settings. When I use Photon servers, the port number would still show as 5058, although the server name would be different (e.g., ns.exitgames.com:5058).

So, my questions are:
- What am I doing wrong/missing in my PhotonServerSettings?
- The classic PUN apparently had a dropdown option in PhotonServerSettings that prompts the user to either 'Use Photon Servers' or 'Select a local server'. I do not see such option in PUN 2. Is changing the 'Server' entry in PhotonServerSettings all that is needed to switch from Photon's hosted server to a locally hosted server? Or should I change anything else?
- How do two apps running on different computers on the same network know that they should connect to the same server, that is also hosted on the same LAN? Is it the AppID that connects them together? Or the server and port number?
- Why is my console message showing 5058 as the connect() port number when I am not explicitly specifying that port?
- If I am running the photon SDK server on two different PCs using the same license, how does Photon know which locally hosted server to use?


Apologies for the lengthy message. I am really lost. Any help is greatly appreciated.

Thanks,
Vijay.



Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Vijay,

    Thank you for choosing Photon!

    As shown on this page, in PUN2, to connect to self-hosted Photon Server you need to:

    1. Disable/Untick/Uncheck "Use NameServer"
    2. Set server address in "Server" field
    3. Optionally set Port in "Port", the default should be 5055 for Master Server (list of ports)

    As shown on this page, AppId and AppVersion/GameVersion are not supported by self-hosted Photon Server.

    If I am running the photon SDK server on two different PCs using the same license
    First you need a special license for this.
    how does Photon know which locally hosted server to use?
    Server address: FQDN or IP.