Can I listen all IPs as UDP listener?
Options
Comments
-
A UDP listener always consists of an IP and a port, so you can specify it like this in PhotonServer.config:
[code2=xml]<UDPListeners>
<!-- all IPs are listening on port 5055 for UDP traffic -->
<UDPListener
IPAddress="0.0.0.0"
Port="5055">
</UDPListener>
<!-- only the private IP listens on port 5056 for UDP traffic -->
<UDPListener
IPAddress="192.168.0.10"
Port="5056">
</UDPListener>
</UDPListeners>[/code2]
Does this help?0 -
Thank you for the reply Nicole!
I know about config files and if I set TCP listener's ip as 0.0.0.0,
there will be "0.0.0.0:[port]" at netstat,
But when I set UDP listener's ip as 0.0.0.0, which means "accept all ips",
photon select all available udp ips and add each of them, -according to log file-
and there's no "0.0.0.0:[port]" kind of stuff at netstat.
Sorry for my bad English but can you help me about this?0 -
I think I don't understand the problem.
It works exactly the same for UDP / TCP. If you configure Photon to listen to "0.0.0.0", it always means that it listens to all available IPs - in TCP and in UDP.0 -
Actually I think that too.
But when I see the log message of the photon,
The log says something like "TCP ips set to 0.0.0.0:5056... set 0.0.0.0:5056 as TCP listener"
But at UDP ip... "UDP ips set to 0.0.0.0:4043... set all available IP as UDP listener".
see below
2276: 21:37:39.302 - Forcing all applications ids to: "Master"
2276: 21:37:39.302 - Adding TCP listener on :0.0.0.0: 4531 with a listen backlog of: 150 <-- TCP add 0.0.0.0 ip as it is.
2276: 21:37:39.302 - TCP inactivity timeout: 5000ms
2276: 21:37:39.302 - TCP disconnect timeout: 120000ms
2276: 21:37:39.302 - MaxInboundMessageSize: 512000
2276: 21:37:39.302 - MaxOutboundMessageSize: 512000
2276: 21:37:39.302 - Forcing all applications ids to: "Game1"
2276: 21:37:39.302 - Adding TCP listener on :0.0.0.0: 4520 with a listen backlog of: 150
2276: 21:37:39.302 - TCP inactivity timeout: 5000ms
2276: 21:37:39.302 - TCP disconnect timeout: 120000ms
2276: 21:37:39.302 - MaxInboundMessageSize: 512000
2276: 21:37:39.302 - MaxOutboundMessageSize: 512000
2276: 21:37:39.302 - Forcing all applications ids to: "Master"
2276: 21:37:39.302 - MaxInboundMessageSize: 512000
2276: 21:37:39.302 - MaxOutboundMessageSize: 512000
2276: 21:37:39.302 - UDP address specified as:0.0.0.0 adding listener to each available IPv4 address <---but UDP searches all available UDPS, not 0.0.0.0 itself.
2276: 21:37:39.302 - Adding UDP listener on :10.0.0.53: 5055 with a listen backlog of: 500
2276: 21:37:39.302 - Adding UDP listener on :169.254.52.196: 5055 with a listen backlog of: 500
2276: 21:37:39.302 - Adding UDP listener on :127.0.0.1: 5055 with a listen backlog of: 500
2276: 21:37:39.302 - Forcing all applications ids to: "Game1"
2276: 21:37:39.303 - MaxInboundMessageSize: 512000
2276: 21:37:39.303 - MaxOutboundMessageSize: 512000
2276: 21:37:39.303 - UDP address specified as:0.0.0.0 adding listener to each available IPv4 address
2276: 21:37:39.303 - Adding UDP listener on :10.0.0.53: 5059 with a listen backlog of: 500
2276: 21:37:39.303 - Adding UDP listener on :169.254.52.196: 5059 with a listen backlog of: 500
2276: 21:37:39.303 - Adding UDP listener on :127.0.0.1: 5059 with a listen backlog of: 500
Which means I can't use ips those are not predefined.0 -
Okay... I think I begin to understand ;-)
So you want to assign IPs to your server AFTER you started Photon and want Photon to listen to them? Or why is this a problem?0 -
You want to assign IPs to your server AFTER you started Photon and want Photon to listen to them?
That's exactly what I want!
Sadly, that's all because our co-company want this feature to make some test QQ(They said it L4 switch related network healthy-test...something).
Thank you for your kindness. Just curious that's possible or not. So I can start to find an alternative way .0 -
Ah, I see. Sorry that it took me so long to understand.
No, unfortunately that is not possible.0