UDP port problems
Options
We have an application that used to work correctly with a self-hosted Photon server using LiteLobby and UDP on port 5055. After updating to current versions of the SDK client and server, we can no longer communicate to our server (Windows 2008 R2) on UDP 5055. It communicates fine using TCP 4530 settings. It also communicates to a different computer (Windows 7) running the same server download and same configuration file on both TCP and UDP.
I am totally lost. Stardust documentation is lacking but I tried using Stardust with the lines
<add key="ServerAddress" value="50.76.169.129:5055" /> (our server's address)
<add key="UseTcp" value="false" />
to attempt to make it use UDP.. This appears to work fine.
The only thing we change in our program is the server address. Again - no problem working with the Windows 7 hosted server. Doesn't work with the Windows Server 2008 machine -- and only with UDP port 5055.
I am totally lost. Stardust documentation is lacking but I tried using Stardust with the lines
<add key="ServerAddress" value="50.76.169.129:5055" /> (our server's address)
<add key="UseTcp" value="false" />
to attempt to make it use UDP.. This appears to work fine.
The only thing we change in our program is the server address. Again - no problem working with the Windows 7 hosted server. Doesn't work with the Windows Server 2008 machine -- and only with UDP port 5055.
0
Comments
-
You checked firewall and config?
The firewall might be opened only for TCP (for whatever reason) and the PhotonServer.config might contain a wrong IP. Make sure you didn't keep the server's config from the old version. Instead merge your machine and application values to the config from the new SDK.
Check the logs for hints of issues. You can spot them easily and if you can't solve a reported issue yourself, you can let us know.
If this doesn't help, attach config and the server logs to the next post.0 -
I had already checked the firewall settings -- both Incoming and Outgoing PhotonSocketServer settings are wide open. I haven't modified the configuration files (didn't need to), so I am just using the one that came with 3.0.15. Logs show UDP listener installed on port 5055 successfully. Attached are the requested files.
Server config:
<?xml version="1.0" encoding="Windows-1252"?>
<!--
(c) 2010 by Exit Games GmbH, http://www.exitgames.com
Photon server configuration file.
For details see the photon-config.pdf.
This file contains two configurations:
"Instance1"
Default. Various applications and demos.
Starts the apps: Lite, LiteLobby, MmoDemo, CounterPublisher and Policy
Listens: udp-port 5055, tcp-port: 4530, 843 and 943
"InstanceLoadBalancing"
Loadbalanced setup for local development: A Master-server and two game-servers.
Starts the apps: Lite, LiteLobby, MmoDemo, CounterPublisher and Policy
Listens: udp-port 5055, tcp-port: 4530, 843 and 943
-->
<Configuration>
<!-- Multiple instances are supported. Each instance has its own node in the config file. -->
<!-- PhotonControl will currently only start "Instance1" but the .cmd files could be modified to start other instances. -->
<!-- Instance settings -->
<Instance1
EnablePerformanceCounters = "true"
DataSendingDelayMilliseconds="5"
AckSendingDelayMilliseconds="5"
PerPeerMaxReliableDataInTransit="16384"
PerPeerTransmitRateLimitKBSec="128"
MaxQueuedDataPerPeer="65536"
MinimumTimeout="5000"
MaximumTimeout="30000"
ProduceDumps="true">
<IOPool/>
<ThreadPool
InitialThreads="4"
MinThreads="4"
MaxThreads="4">
</ThreadPool>
<!-- Using the same value for initial, min and max makes the pool fixed size, which allows optimizations. -->
<ENetThreadPool
InitialThreads="2"
MinThreads="2"
MaxThreads="2">
</ENetThreadPool>
<!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. -->
<!-- Port 5055 is Photon's default for UDP connections. -->
<UDPListeners>
<UDPListener
IPAddress="0.0.0.0"
Port="5055">
</UDPListener>
</UDPListeners>
<!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. -->
<!-- Port 5055 is Photon's default for TCP connecttions. -->
<TCPListeners>
<TCPListener
IPAddress="0.0.0.0"
Port="4530"
DisableNagle="true"
InactivityTimeout="5000">
</TCPListener>
</TCPListeners>
<!-- Policy request listener for Unity and Flash (port 843) and Silverlight (port 943) -->
<TCPPolicyListeners>
<!-- multiple Listeners allowed for different ports -->
<TCPPolicyListener
IPAddress="0.0.0.0"
Port="843"
Application="Policy"
InactivityTimeout="5000">
</TCPPolicyListener>
<TCPPolicyListener
IPAddress="0.0.0.0"
Port="943"
Application="Policy"
InactivityTimeout="5000">
</TCPPolicyListener>
</TCPPolicyListeners>
<!-- WebSocket (and Flash-Fallback) compatible listener -->
<WebSocketListeners>
<WebSocketListener
IPAddress="0.0.0.0"
Port="9090"
DisableNagle="true"
InactivityTimeout="100000"
OverrideApplication="LiteWebSockets">
</WebSocketListener>
</WebSocketListeners>
<!-- Defines the Photon Runtime Assembly to use. -->
<Runtime
Assembly="PhotonHostRuntime, Culture=neutral"
Type="PhotonHostRuntime.PhotonDomainManager"
UnhandledExceptionPolicy="Ignore">
</Runtime>
<!-- Defines which applications are loaded on start and which of them is used by default. Make sure the default application is defined. -->
<!-- Application-folders must be located in the same folder as the bin_win32 folders. The BaseDirectory must include a "bin" folder. -->
<Applications Default="Lite">
<!-- Lite Application -->
<Application
Name="Lite"
BaseDirectory="Lite"
Assembly="Lite"
Type="Lite.LiteApplication"
EnableAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
</Application>
<!-- LiteLobby Application -->
<Application
Name="LiteLobby"
BaseDirectory="LiteLobby"
Assembly="LiteLobby"
Type="LiteLobby.LiteLobbyApplication"
EnableAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
</Application>
<!-- MMO Demo Application -->
<Application
Name="MmoDemo"
BaseDirectory="MmoDemo"
Assembly="Photon.MmoDemo.Server"
Type="Photon.MmoDemo.Server.PhotonApplication"
EnableAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
</Application>
<!-- Websockets Application -->
<Application
Name="LiteWebSockets"
BaseDirectory="LiteWebSockets"
Assembly="Lite"
Type="Lite.LiteApplication">
</Application>
<!-- CounterPublisher Application -->
<Application
Name="CounterPublisher"
BaseDirectory="CounterPublisher"
Assembly="CounterPublisher"
Type="Photon.CounterPublisher.Application"
EnableAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
</Application>
<!-- Flash & Silverlight Policy Server -->
<Application
Name="Policy"
BaseDirectory="Policy"
Assembly="Policy.Application"
Type="Exitgames.Realtime.Policy.Application.Policy">
</Application>
</Applications>
</Instance1>
<InstanceLoadBalancing
EnablePerformanceCounters = "true"
DataSendingDelayMilliseconds="50"
AckSendingDelayMilliseconds="50"
PerPeerMaxReliableDataInTransit="16384"
PerPeerTransmitRateLimitKBSec="128"
MaxQueuedDataPerPeer="65536"
MinimumTimeout="5000"
MaximumTimeout="10000">
<IOPool/>
<ThreadPool
InitialThreads="4"
MinThreads="4"
MaxThreads="4">
</ThreadPool>
<!-- Using the same value for initial, min and max makes the pool fixed size, which allows optimizations. -->
<ENetThreadPool
InitialThreads="2"
MinThreads="2"
MaxThreads="2">
</ENetThreadPool>
<!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. -->
<!-- Port 5055 is Photon's default for UDP connections. -->
<UDPListeners>
<UDPListener
IPAddress="0.0.0.0"
Port="5055"
OverrideApplication="Master">
</UDPListener>
<UDPListener
IPAddress="0.0.0.0"
Port="5056"
OverrideApplication="Game1">
</UDPListener>
<UDPListener
IPAddress="0.0.0.0"
Port="5057"
OverrideApplication="Game2">
</UDPListener>
</UDPListeners>
<!-- 0.0.0.0 opens listeners on all available IPs. Machines with multiple IPs should define the correct one here. -->
<!-- Port 5055 is Photon's default for TCP connecttions. -->
<TCPListeners>
<!-- TCP listener for Game clients on Master application -->
<TCPListener
IPAddress="0.0.0.0"
Port="4530"
OverrideApplication="Master"
DisableNagle="true"
InactivityTimeout="0">
</TCPListener>
<TCPListener
IPAddress="0.0.0.0"
Port="4531"
OverrideApplication="Game1"
DisableNagle="true"
InactivityTimeout="0">
</TCPListener>
<TCPListener
IPAddress="0.0.0.0"
Port="4532"
OverrideApplication="Game2"
DisableNagle="true"
InactivityTimeout="0">
</TCPListener>
<!-- DON'T EDIT THIS. TCP listener for GameServers on Master application -->
<TCPListener
IPAddress="0.0.0.0"
Port="4520"
DisableNagle="true"
InactivityTimeout="0">
</TCPListener>
</TCPListeners>
<!-- Policy request listener for Unity and Flash (port 843) and Silverlight (port 943) -->
<TCPPolicyListeners>
<!-- multiple Listeners allowed for different ports -->
<TCPPolicyListener
IPAddress="0.0.0.0"
Port="843"
Application="Policy"
InactivityTimeout="5000">
</TCPPolicyListener>
</TCPPolicyListeners>
<!-- Defines the Photon Runtime Assembly to use. -->
<Runtime
Assembly="PhotonHostRuntime, Culture=neutral"
Type="PhotonHostRuntime.PhotonDomainManager"
UnhandledExceptionPolicy="Ignore">
</Runtime>
<!-- Defines which applications are loaded on start and which of them is used by default. Make sure the default application is defined. -->
<!-- Application-folders must be located in the same folder as the bin_win32 folders. The BaseDirectory must include a "bin" folder. -->
<Applications Default="Master">
<Application
Name="Master"
BaseDirectory="LoadBalancing\Master"
Assembly="Photon.LoadBalancing"
Type="Photon.LoadBalancing.MasterServer.MasterApplication">
</Application>
<Application
Name="Game1"
BaseDirectory="LoadBalancing\GameServer1"
Assembly="Photon.LoadBalancing"
Type="Photon.LoadBalancing.GameServer.GameApplication"
EnableAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
</Application>
<Application
Name="Game2"
BaseDirectory="LoadBalancing\GameServer2"
Assembly="Photon.LoadBalancing"
Type="Photon.LoadBalancing.GameServer.GameApplication"
EnableAutoRestart="true"
WatchFiles="dll;config"
ExcludeFiles="log4net.config">
</Application>
<Application
Name="Policy"
BaseDirectory="Policy"
Assembly="Policy.Application"
Type="Exitgames.Realtime.Policy.Application.Policy"
EnableAutoRestart="true"
WatchFiles="dll;config;xml"
ExcludeFiles="log4net.config">
</Application>
</Applications>
</InstanceLoadBalancing>
</Configuration>
Server Logs:
4980: 17:55:23.592 - ---
4980: 17:55:23.592 - Service: "Photon Socket Server" starting
4980: 17:55:23.592 - Config File: E:\Photon\ExitGames-Photon-Server-SDK_v3-0-15-2544-RC7\deploy\bin_Win64_xp\PhotonServer.config
4980: 17:55:23.592 - Will produce at most: 10 crash dumps
4708: 17:55:23.592 -
4708: 17:55:23.592 - WARNING: ***************************************************************
4708: 17:55:23.592 - WARNING: Photon has been built to operate on an operating system earlier than Windows Vista.
4708: 17:55:23.592 - WARNING: Performance will not be as good as when built for Windows Vista or later.
4708: 17:55:23.592 - WARNING: ***************************************************************
4708: 17:55:23.592 -
4708: 17:55:23.592 - Server Starting...
4708: 17:55:23.592 - Tick count: 226112373 (wraps in: 47.0932 days)
4708: 17:55:23.592 - Photon Version: 3.0.9.841
4708: 17:55:23.592 - Current directory is: C:\Windows\system32
4708: 17:55:23.592 - Changing current directory to: E:\Photon\ExitGames-Photon-Server-SDK_v3-0-15-2544-RC7\deploy\bin_Win64_xp
4708: 17:55:23.592 - Config File: E:\Photon\ExitGames-Photon-Server-SDK_v3-0-15-2544-RC7\deploy\bin_Win64_xp\PhotonServer.config
4708: 17:55:23.623 - Not using performance counters. The installed counters do not match the counter dll
4708: 17:55:23.623 - Run the service with /InstallCounters to reinstall the latest counters.
4708: 17:55:23.638 - About to load runtime: PhotonHostRuntime.PhotonDomainManager from PhotonHostRuntime, Culture=neutral, PublicKeyToken=02C301B61B060C4D
4708: 17:55:23.638 - About to load CLR - versions available:
4708: 17:55:23.638 - v2.0.50727
4708: 17:55:23.638 - v4.0.30319
4708: 17:55:23.638 - No preference in configuration file, will load latest.
4708: 17:55:23.638 - About to load version: "v4.0.30319"
4708: 17:55:23.638 - Loaded version: "v4.0.30319"
4708: 17:55:37.336 - Photon host runtime loaded
4708: 17:55:41.142 - License is valid.
4708: 17:55:41.142 - Licensed for unlimited concurrent connections.
4708: 17:55:41.142 - Max Reliable Data In Transit (awaiting ACKs) per peer : 16384 bytes
4708: 17:55:41.142 - Per peer bandwidth limit
4708: 17:55:41.142 - Transmit Rate Limit: 128 KB/Sec
4708: 17:55:41.142 - Limit period: 250ms
4708: 17:55:41.142 - Limit per period: 32768 bytes
4708: 17:55:41.142 - Max queued data for transmission per peer: 65536 bytes
4708: 17:55:41.142 - Minimum retransmit timeout: 200
4708: 17:55:41.142 - Minimum ENet timeout: 5000ms
4708: 17:55:41.142 - Maximum ENet timeout: 30000ms
4708: 17:55:41.142 - ENetHost: Using Timer Wheel
4708: 17:55:41.142 - About to load application: Lite from Lite
4708: 17:55:41.142 - Auto restart is enabled for application
4708: 17:55:41.142 - Application will restart 10000ms after the last change detected
4708: 17:55:41.142 - Application will restart if files matching the following are changed: "dll;config"
4708: 17:55:41.142 - Application will NOT restart if files matching the following are changed: "log4net.config"
4708: 17:55:50.689 - Application: "Lite" started in app domain: 2
4708: 17:55:50.689 - About to load application: LiteLobby from LiteLobby
4708: 17:55:50.689 - Auto restart is enabled for application
4708: 17:55:50.689 - Application will restart 10000ms after the last change detected
4708: 17:55:50.689 - Application will restart if files matching the following are changed: "dll;config"
4708: 17:55:50.689 - Application will NOT restart if files matching the following are changed: "log4net.config"
4708: 17:56:00.346 - Application: "LiteLobby" started in app domain: 3
4708: 17:56:00.346 - About to load application: MmoDemo from Photon.MmoDemo.Server
4708: 17:56:00.346 - Auto restart is enabled for application
4708: 17:56:00.346 - Application will restart 10000ms after the last change detected
4708: 17:56:00.346 - Application will restart if files matching the following are changed: "dll;config"
4708: 17:56:00.346 - Application will NOT restart if files matching the following are changed: "log4net.config"
4708: 17:56:09.722 - Application: "MmoDemo" started in app domain: 4
4708: 17:56:09.722 - About to load application: LiteWebSockets from Lite
4708: 17:56:19.597 - Application: "LiteWebSockets" started in app domain: 5
4708: 17:56:19.597 - About to load application: CounterPublisher from CounterPublisher
4708: 17:56:19.597 - Auto restart is enabled for application
4708: 17:56:19.597 - Application will restart 10000ms after the last change detected
4708: 17:56:19.597 - Application will restart if files matching the following are changed: "dll;config"
4708: 17:56:19.597 - Application will NOT restart if files matching the following are changed: "log4net.config"
4708: 17:56:31.562 - Application: "CounterPublisher" started in app domain: 6
4708: 17:56:31.562 - About to load application: Policy from Policy.Application
4708: 17:56:42.670 - Application: "Policy" started in app domain: 7
4708: 17:56:42.670 - Adding TCP listener on :0.0.0.0: 4530 with a listen backlog of: 150
4708: 17:56:42.670 - Nagle disabled
4708: 17:56:42.670 - TCP inactivity timeout: 5000ms
4708: 17:56:42.670 - UDP address specified as:0.0.0.0 adding listener to each available IPv4 address
4708: 17:56:42.670 - Adding UDP listener on :50.76.169.129: 5055 with a listen backlog of: 500
4708: 17:56:42.670 - Adding UDP listener on :192.168.147.104: 5055 with a listen backlog of: 500
4708: 17:56:42.670 - Adding UDP listener on :192.168.136.1: 5055 with a listen backlog of: 500
4708: 17:56:42.670 - Adding UDP listener on :192.168.131.1: 5055 with a listen backlog of: 500
4708: 17:56:42.670 - Adding UDP listener on :127.0.0.1: 5055 with a listen backlog of: 500
4708: 17:56:42.670 - Adding TCP Policy listener on :0.0.0.0: 843 with a listen backlog of: 150 and routing to application: "Policy"
4708: 17:56:42.670 - TCP inactivity timeout: 5000ms
4708: 17:56:42.670 - Adding TCP Policy listener on :0.0.0.0: 943 with a listen backlog of: 150 and routing to application: "Policy"
4708: 17:56:42.670 - TCP inactivity timeout: 5000ms
4708: 17:56:42.670 - Adding WebSocket TCP listener on :0.0.0.0: 9090 with a listen backlog of: 150
4708: 17:56:42.670 - Nagle disabled
4708: 17:56:42.670 - TCP inactivity timeout: 100000ms
4708: 17:56:42.670 - Forcing all applications ids to: "LiteWebSockets"
4708: 17:56:46.538 - Service is running...0 -
This looks good. It starts and opens the ports as assigned: "Adding UDP listener on :50.76.169.129: 5055".
I can't explain the issue from these logs.
Maybe you remove the firewall settings for Photon and re-add it. If you can reach the server with a locally running client but not from outside, it has be the the firewall or routing (unless the ports are unavailable).0 -
Yes, you would think that is the case.. I have no clue at this point, so I might just have to spend the time with Wireshark to see if there is any more information that would shed some light on the subject. I have rechecked the firewall several times -- everything is open to Photon. UDP isn't critical for us at this point - we switched over to TCP for the time being, but UDP will be be important later. The problem began with one of the last Photon updates.0
-
You said it worked fine with Stardust, correct? In this case, the server side seems okay...
Which client SDK are you using? Is it .NET?
Can you double check the client code and verify that the PhotonPeer is created with "useTCP" = false? Probably the client still tries to open TCP connections...0