connecting by public ip

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Photon Server.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

connecting by public ip

brian661
2014-04-09 10:25:52

I have complete my game with Photon server while I am just connecting with local IP address, which get from Photon Server--> Game Server IP Config-->set local: 192.168.0.100

In the code, my game is connecting using this.peer.Connect("192.168.0.100:5055", "EZServer") and everything work prefect.

While now i would like to public my game by connecting with public address. but connecting is fail.

How can I solve this problem?

Comments

chvetsov
2014-04-09 11:15:39

Hi, brian661 Solution depends on how do you host your server. if you use cloud then you should get all connection parameters from our support team. if you use your own server you should fix public ip for it and use it in your game client

brian661
2014-04-09 12:54:21

I am not using Cloud and using my own server . How can i "fix public ip"? i have try this.peer.Connect("219.79.231.217:5055", "EZServer") where the ip is copy from what i can see in the Photon control-->game server ip config-->set public but seem I cannot connect to the server

chvetsov
2014-04-10 11:03:13

you should setup ip for your server in server config find section <UDPListeners> for UDP and <TCPListeners> for TCP you should have doc about server configuration, please read carrefully

brian661
2014-04-11 11:45:39

http://doc.exitgames.com/en/onpremise/c ... ver-config I tried to follow the instruction in the UDPListener and set the following setting (both on around line 35 and line 157)

and define the application following the sample code.

while both i get the exception 2204: 19:38:54.900 - CService::OnException() - Exception: CSocket::Bind() 219.79.231.217:5055 - 內容中所要求的位址不正確。 (should be meaning that the ip address is not correct, while i copy the address from Photon Control's IP config)

Sorry for asking a lot of question, this is the first time I code something related to interent connection and the first time i heard about UDP or TCP

chvetsov
2014-04-14 11:07:20

According what i can see from your messages config is correct. I assume that you forgot to configure your firewall. I belive that if you are not expirienced in this, it will better to switch it off. and later when everything will work, you may switch it on and setup correctly with someones help

[Deleted User]
2014-04-14 12:51:07

No, this is not related to the firewall, and you don't need to set anything in the PhotonServer.config.

In the Photon config, keep "IPAddress="0.0.0.0". This means that Photon listens to all available network interface cards.

The public IP address belongs to your router, not to your machine: You need to configure port-forwarding in your router, so that it passes all traffic to "219.79.231.217:5055" forward to your machine ("192.168.0.100:5055"). In Photon Control, you need to set the GameServer config to "Auto-Detect (Public IP)".

You can search for port-forwarding on this forum, the topic has been discussed multiple times. Several people reported that they did not manage to set this up successfully because it seems that some internet providers are dropping UDP traffic to customer endpoints - so I hope you have luck with your setup.

If not, you might want to rent a cheap virtual server with a dedicated IP for your testing.

Back to top