Documentation

calbert
edited April 2010 in Photon Server
I have looked through all of the documents I currently have but cannot find any documentation on the Configuration file for the Socket Server. Specifically, What does the number in DebugLevel mean and what kind of options are available through the config file?

The config actually says to reference the Photon Operator's Manual, which I do not seem to have nor can I find, am I missing something?

Thanks,
Cameron

Comments

  • :o

    You're right. There is a detailed documentation, but it did not make it into the SDKs so far.
    Maybe this helps you already:

    The PhotonSocketServer.xml file is used to setup applications and protocols for IPs. It also includes some performance specific values that should (in general) not be changed. The default values make sure the server scales nicely on more cores but does not overwhelm a regular machine.

    Most interesting are these settings:
    UDPListener and TCPListener: they configure UDP and TCP endpoints on your machine respectively. You can use either or both (e.g. if you don't need TCP). The default IP 0.0.0.0 used in the SDKs lets Phonton listen on any available IP.

    TCPSilverlightListeners and TCPFlashListeners: could be removed but are needed when you create Silverlight or Flash games respectively. Both client-side plugins require a server to respond with a "policy file" (unless the website is on the same domain as Photon).

    Applications node: Defines a set of applications that should be started within this Photon instance. In Photon, we run several applications on the same IP:port and route clients to each by an appId (set on connect). Each app in turn has it's own setup. The Applications node defines a default app (if the client tries to connect to a non-existing app).

    Application: Defines where to find the applications DLLs and the main class to run as PhotonApplication. You can remove any app you don't need and then you don't have to deploy it.

    DebugLevel: is only used in debug builds of Photon. All regular SDKs are release builds. Otherwise it sets a level of debug logging inside the Photon Core C++ part.
    We use log4net throughout the C# business logic. This has it's own config files and is rather useful and versatile.
  • Thanks, looks like the long and short of it is, don't change these values other than defining Applications :)

    I have been using log4net, was just wondering if changing the debug level would print some debug stuff from the core socket server.
  • calbert wrote:
    Thanks, looks like the long and short of it is, don't change these values other than defining Applications :)

    wouldn't sign that :)
    depending on your server, the threads value is pretty important for scaling.
  • Thanks, I will keep that in mind.
  • On a side note, in the PhotonSocketServer.xml, you will want to change all of the 0.0.0.0 to your physical IP of your server if you are running a virtual server or if you are running in a local personal network. Although the logs show both 0.0.0.0:5055 and your ServerIP:5055 when it starts as listening, I could not get a connection until I changed out all of the 0.0.0.0 IP's with the physical IP of the box. The XML does state to list all of the IP's in use but doesn't say how to, so if your server has a multi home nic, I have no clue how to set the XML to listen on multiple. My internal Dev machine IP is 192.168.0.191 for instance, but until I changed the PhotonSocketServer.xml IP's from 0.0.0.0 to 192.168.0.191 ever where in the XML, I couldn't connect to the server it was if it was not listening but in the logs, it said that everything started successfully and was listening.

    I first blamed it on my firewall, so I nuked my firewall, turned everything off and tried again, no go, then I looked at the XML, added the IP over the 0.0.0.0, restarted my firewall back to normal and wala, everything works!
    Best regards
  • I can see that causing major problems if hosted on Azure, since you do not and will not know the external IP. You can lookup the VM IP but that would have to be done in code rather than a config.
  • It's the same on other clouds, yes.

    We are preparing a new SDK release which takes care of this. With this, "floating" licenses won't need to be bound to a machine or IP. Then they can be used in clouds easily.
  • I can confirm - I just bumped into the same weird behavior of Photon Server. Do you have any estimates on in which Server SDK version this will be solved?
  • The release candidate of the new Server SDK is in "test mode" now and hopefully we will have it out until the end of the week.
  • Great to hear.
    Looking forward to it especially due to the client sdk documented changes with the 1.8 server sdk