Problem with server port configuration for Unity client

killme
edited August 2011 in DotNet
I use the following ports numbers :
- 8558 for UDP tranferts
- 8559 for TCP transferts
- 843 for TCP policy

When I use a standalone Unity application, I can connect to my server and my transferts are good.
But when I use a webplayer Unity application, I can't connect to my server.

Someone have an explain ?

Comments

  • More details : the "PeerStatusCallback" event give me the "SecurityExceptionOnConnect" code (1022)
  • It seems like the policy application is not available. Either the port 843 is blocked by some firewall (maybe it's the windows Firewall?!) OR the policy application is not started. Please verify in the PhotonCLR.log that "Policy" is loaded.
    Some tips regarding the firewalls: http://developer.exitgames.com/photonse ... llsettings
  • I have these lines of log (PhotonCLR.log) :
    2011-03-30 13:40:37,375 [ 1] INFO PhotonHostRuntime.PhotonDomainManager - CreateAppDomain Policy , Policy.Application
    2011-03-30 13:40:37,375 [ 1] DEBUG PhotonHostRuntime.PhotonDomainManager - CreateAppDomain: ApplicationBase = C:\Photon\deploy
    2011-03-30 13:40:37,375 [ 1] DEBUG PhotonHostRuntime.PhotonDomainManager - CreateAppDomain: PrivateBinPath = Policy\Policy.Application;Policy\Policy.Application\bin;bin_Win32_xp;Shared
    2011-03-30 13:40:37,375 [ 1] DEBUG PhotonHostRuntime.PhotonDomainManager - CreateAppDomain: ConfigurationFile = C:\Photon\deploy\Policy\Policy.Application\bin\Policy.Application.dll.config
    Policy application is it started ?

    It's very strange. When I tryed localy my webplayer application, it didn't work (with the same ports). But when I used the port 5055 for UDP, it worked.
    It looks as if the webplayer application mode didn't take the port number parameter.
    I will open the UDP port 5055 to test but it's not the wanted configuration.
  • I forgot:
    The policy file of course does not allow connections on just any port but only on those we use by default. As the policy is a file and read on start, you need to adjust it, corresponding to your port changes.

    Find:
    sdk\deploy\Policy\Policy.Application\assets\socket-policy.xml and modify the listed ports.
    The socket-policy-silverlight.xml file is used when a policy request is coming into port 943 (from Silverlight clients) and does not apply here.

    I tested this and locally it worked fine for the webplayer settings.
  • Thanks. It's ok localy.
    But it'doesn't work on my server.
    I'll verify that the 843 port is open.

    Another question : can I change the 843 port to another number ? or it's mandatory ?
  • If you changed the policy files already, something must be blocking the port on your server. The clients work with a changed port locally and there is no real difference with a remote server. At least none we stumbled across so far ;)

    The policy port is semi mandatory. We just used the default Unity port for this.
    As long as we know the port, the policy application could hand out the correct file. Flash and Unity are identical but Silverlight also uses a policy file but not the same.

    You should be able to modify the (extremely simple) Policy application and change that, too.
  • You can enable debug logging for the policy app to verify that you receive the policy requests.
    the log4net file for this is in the policy\assets folder.
    when a policy file is sent a "Policy sent" should appear in the policy.log file.
  • Thanks a lot.

    My webplayer application is ok. My server administrator had not opened port 843. Just a synchro problem :oops:
    So now, with the good Policy config and the good port it's ok.
  • Thanks for letting us know!
  • 0 — 1024 is known as the reserved port range (traditionaly only root can assign programs to ports in this range)
    And on my server port 843 is blocked.

    How to change port 843 on port 1843((for example))?

    I changed port(843) in PhotonSocketServer.config, but unity3d displayed error with crossdomain.
  • you must prefetch the security policy then on unity if you don't use the default port as unity won't test any other port (cause testing the other 65534 would be inefficient and time consuming)

    also on a server 843 should never be blocked, if it is contact the admin after you ensured that it was not your error by forgetting to enable portforwarding within the windows firewall ;)