Most of the Photon server operations can be done using PhotonControl application. However, if you prefer command-line tools Photon already has what you need.
"PhotonSocketServer.exe" contains the commands necessary related to Photon server. It can be found in any of the "deploy\bin_*" folders inside the Photon server SDK.
You can list all the commands and arguments possible using the
All the commands support a silent mode using
This mode disables the creation of pop up dialogs in case of error.
It is useful for automation purposes.
Photon As A Windows Service
To install Photon server as a Windows service:
Then you can use the Windows
sc command to start and stop the Photon service.
To uninstall the Photon Windows service you can use:
Photon As A Process
To start a Photon instance for debugging, the most simple command is:
Depending on the configuration, one Photon server instance may contain more than one Photon server application. But each Photon server instance requires a PhotonSocketServer process.
To stop all running Photon server instances at once:
To stop a specific Photon server instance:
Using Configuration Files
By default, Photon uses configuration file "PhotonServer.config" in the working directory (same folder as "PhotonSocketServer.exe").
If you want to use a custom filename, for instance when you have multiple configurations, you can use:
If you want to explicitly specify a configuration file by path, you can use:
Photon server will not start if the configuration file could not be found.
Photon Performance Counters
To install Windows performance counters for Photon:
If you want to remove them you can use:
In this complete workflow example we will demonstrate how to install Photon server on a production machine. The Windows service configuration, as well as the use of logman are just suggestions.
- Download, unblock and then unpack the content of the Photon server SDK to "C:\Photon"
From Windows command line, go to the binary folder of your choice:
(OPTIONAL) To setup counters and counter logging (using logman):
Install Photon as service:
(OPTIONAL) Configure the service:
sc.exe config 'Photon Socket Server: LoadBalancing' depend=iphlpsvc/TermService start=delayed-auto
Starting and Stopping the service:
To remove the counters and the service: