Cant Connect From Other Computer
The whole answer can be found below.
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).
Cant Connect From Other Computer
ViniciusJose
2012-03-03 23:51:58
Hi,
I made a project using LiteLobby for a UnityClient and i can connect with the client in the "localhost:5055" or the ip of the server "192.168.0.xxx:5055", but im trying to connect with the client from another computer in the same network and it doesnt works, and i dont get the error on photonserver logs, anyway i can trade files with this computer (the network works).
All the configuration on the server keeps the basics (default), i just added a new tag "application" for my game server.
Anyone knows why i cant connect with another computer on the server?
Comments
If its not the same network anymore (not 192.168.0.xxx) then you will need to setup the portforwards according to your photon settings in the router to make it work again.
ViniciusJose
2012-03-04 13:19:51
Hi Dreamora, Thank for the Help!
I didnt understand what you said, here's the situation with more details:
I made a server on my computer to develop the game, and i can connect in the server if i run the client in the same computer, but now i need to test more than one player connected and i cant connect from another computer in the same lan.
I checked the firewall and it's ok, i turned it off to test too but the problem don't stop.
I can trade files in the lan with this computer (can see each other).
I'm using the UDP protocol to connect with the client. Running netstat -a i can see the port 5055 only in the following ip:
Proto Local Adress External Adress State UDP 192.168.0.102:5055 :
The interesting is that the state dont change to "listening" when im already connected to the server.
As i mentioned the configuration on the server keeps the basics, i only add an "Application" tag for my game server. I need to change any configuration on the "PhotonServer.config" file? Like the "UDPListeners", "TCPListeners" tags?
Another thing, the client is an Unity Web Application.
If the problem can be the firewall i will review the configuration.
If the application is a webapplication, TCP 843 must be forwarded as well (socket policy server), assuming you didn't change the port in the config. This 'forwarding' means portforwarding in the router if the connection is from outside the router, but also on the software firewall(s) where you need to allow it if you dodn't do it yet.
In the same LAN (ie all have 192.168.0.xxxx IPs) the portforwarding isn't needed, this is correct. But if this is just one of multiple vlans within your network and others are not in the 192.168.0.xxx range you must setup the router to your sub network for portforwarding too, as 'not in here' is simply 'not in here' from the routers point of view, if the other side is a higher level lan or the internet makes no difference for the router :)
ViniciusJose
2012-03-04 14:21:44
I checked the network and we dont have vlans, any computer connected is on the same network adress. As default the PhotonServer.config have two declarations of the port 843, following bellow:
<!-- 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>
<!-- 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>
Is that configuration you meaned to setup?
ViniciusJose
2012-03-04 14:43:53
Hi Dreamora,
Thank for the help!
We solved our problem, aparently the McAffe was blocking the access with firewall. Turning it off we can connect!
Thanks!
Glad you could nail the issue.
You can add the PhotonSocketServer.exe with exceptions for UDP 5055, TCP 4530 and 843 then it should work fine :)
I am having the same issue, but I turned off all firewalls and I still can't get things to work with two different computers on the same network.
It works fine when I play in the unity editor, then run a build on the same computer, everything works and I can play multiplayer.
I tried logging in using my phone on one of the computers, but still no go. Any thoughts on how to resolve is greatly appreaciated.
hi, @Hipshot
can you say on what stage you fail to connect?
when you connect to master or to GS?
what version of sdk are you using? if sdk 5 please check NameServer.json and fix master server address because it is set to 127.0.0.1.
Also you need to fix PublicIpAddress in GameServer.xml.config
best,
ilya
[SOLVED]
This was a regions issue. I set usw for the region and fixed region in Photon settings in Unity, and only whitelisted usw in the photon account.
hi, @Hipshot
for Selfhosted you do not have to do anything in your photon account. only local settings make sense
best,
ilya
Hi, @chvetsov I have a setup where one pc is connected to the router through ethernet, while another pc can be connected through wifi to the router. I configured namesever.json and gameserver.xml files to the correct ip address but the error "Failed to connect to server after testing each known Ip" appears. Any help to have this fixed/
hi, @Treshan it would be good if you create new topic next time
does everything start to work when both connected to WiFi or both connected to ethernet? are you able to connect from same PC?
what version of Server SDK do you use? What version of client?
best,
ilya
@chvetsov I connected both with ethernet cable and played with different IP addresses. Now I receive "ErrorCode:10054 SocketErrorCode: ConnectionReset Message : An existing connection was forcibly closed by remote host" both in the server and the client. I use server sdk v5.0.12
This is likely a firewall issue. It can actively refuse the connection (while Photon wouldn't).
Back to top