Trouble getting Photon working on AWS EC2 instance

legend411legend411 ✭✭
Hey there. I set up a windows EC2 instance on AWS, set up my security group and all security provisions outlined by Tobias in this thread (including the windows firewall stuff through remote desktop): viewtopic.php?f=6&t=8

...downloaded the latest photon server SDK, set it up on the server and ran the Win64 PhotonControl; installed both PhotonInstance1 and InstanceLoadBalancing as services and have them running, and I am getting the "Authentication failed, Check AppId." when I try to run my menu scene in Unity. I ran the Setup Wizard in Unity and pointed it to my AWS IP address, which I know is correct, with a port of 5055.

The only thing I do notice that is fishy is InstanceLoadBalancing keeps randomly stopping, because when I look at it on the tray icon on the server, everything is grayed out except "Start Service" again (but when I start it, it does run for a while, from the looks of it).

Comments

  • Alright so I realized I want to have InstanceLoadBalancing on and Instance1 off, I didn't realize they were mutually exclusive. So I got that worked out and restarted my server, but now I get:
    Error trying to receive. Exception: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host.
    
  • Here's my logs, if it helps.
    1100: 03:41:06.548 - Application will restart if files matching the following are changed: "dll;config"
    1100: 03:41:06.548 - Application will NOT restart if files matching the following are changed: "log4net.config"
    1100: 03:41:18.312 - Application: "Lite" started in app domain: 2
    1100: 03:41:18.312 - About to load application: LiteLobby from LiteLobby
    1100: 03:41:18.312 - Auto restart is enabled for application
    1100: 03:41:18.312 - Application will restart 10000ms after the last change detected
    1100: 03:41:18.312 - Application will restart if files matching the following are changed: "dll;config"
    1100: 03:41:18.312 - Application will NOT restart if files matching the following are changed: "log4net.config"
    1100: 03:41:30.232 - Application: "LiteLobby" started in app domain: 3
    1100: 03:41:30.232 - About to load application: MmoDemo from Photon.MmoDemo.Server
    1100: 03:41:30.232 - Auto restart is enabled for application
    1100: 03:41:30.232 - Application will restart 10000ms after the last change detected
    1100: 03:41:30.232 - Application will restart if files matching the following are changed: "dll;config"
    1100: 03:41:30.232 - Application will NOT restart if files matching the following are changed: "log4net.config"
    1100: 03:41:37.721 - Application: "MmoDemo" started in app domain: 4
    1100: 03:41:37.721 - About to load application: LiteWebSockets from Lite
    1100: 03:41:51.498 - Application: "LiteWebSockets" started in app domain: 5
    1100: 03:41:51.498 - About to load application: CounterPublisher from CounterPublisher
    1100: 03:41:51.498 - Auto restart is enabled for application
    1100: 03:41:51.498 - Application will restart 10000ms after the last change detected
    1100: 03:41:51.498 - Application will restart if files matching the following are changed: "dll;config"
    1100: 03:41:51.498 - Application will NOT restart if files matching the following are changed: "log4net.config"
    1100: 03:41:58.722 - Application: "CounterPublisher" started in app domain: 6
    1100: 03:41:58.722 - About to load application: Policy from Policy.Application
    1100: 03:42:21.501 - Application: "Policy" started in app domain: 7
    1100: 03:42:21.548 - Adding TCP listener on :0.0.0.0: 4530 with a listen backlog of: 150
    1100: 03:42:21.548 - Nagle disabled
    1100: 03:42:21.548 - TCP inactivity timeout: 5000ms
    1100: 03:42:21.579 - UDP address specified as:0.0.0.0 adding listener to each available IPv4 address
    1100: 03:42:21.844 - Adding UDP listener on :10.40.235.73: 5055 with a listen backlog of: 500
    1100: 03:42:21.844 - Adding UDP listener on :127.0.0.1: 5055 with a listen backlog of: 500
    1100: 03:42:21.844 - Adding TCP Policy listener on :0.0.0.0: 843 with a listen backlog of: 150 and routing to application: "Policy"
    1100: 03:42:21.844 - TCP inactivity timeout: 5000ms
    1100: 03:42:21.844 - Adding TCP Policy listener on :0.0.0.0: 943 with a listen backlog of: 150 and routing to application: "Policy"
    1100: 03:42:21.844 - TCP inactivity timeout: 5000ms
    1100: 03:42:21.844 - Adding WebSocket TCP listener on :0.0.0.0: 9090 with a listen backlog of: 150
    1100: 03:42:21.844 - Nagle disabled
    1100: 03:42:21.844 - TCP inactivity timeout: 100000ms
    1100: 03:42:21.844 - Forcing all applications ids to: "LiteWebSockets"
    1100: 03:42:30.738 - CService::OnException() - Exception: CSocket::Bind() 0.0.0.0:4530 - Only one usage of each socket address (protocol/network address/port) is normally permitted.
    1100: 03:42:30.738 - Server shutting down...
    1100: 03:42:30.738 - Notifying CLR applications of shutdown...
    1100: 03:42:30.753 - Shutting down TCP Outbound Connection Manager...
    

    Notice the Exception on port 4530, I checked netstats and task manager, there is nothing besides Photon using 4530.
  • It doesn't start, cause a port is in use before Photon starts and tries to use the same port:
    Exception: CSocket::Bind() 0.0.0.0:4530 - Only one usage of each socket address (protocol/network address/port) is normally permitted.

    You need to find the app that's using this port and close it, or reconfigure Photon to use another.
    Maybe Photon is already running? On a server, you would install it as service, so it's running even if you're not logged on.
Sign In or Register to comment.