Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

AWS EC2 (Linux) - Problems hosting unity server

Discussion in 'Multiplayer' started by Nexile_Erk, Sep 9, 2021.

  1. Nexile_Erk

    Nexile_Erk

    Joined:
    Aug 30, 2021
    Posts:
    2
    Hi,

    I'm having some issues getting my unity server to work on Amazons EC2. The issue I am having is the server not running properly (?). From the logs, I can see the server starts and runs, but there is no connection to it.

    I've tried checking which ports the instance is listening to once unity server is running (via netstat -tnlp) and the specified port is not included in the list.
    netstat.png

    I am using the LiteNetLib library for networking. When running a Windows build, it works perfectly fine (locally or over same network).

    Some more EC2 info
    - Tested with Ubuntu 20.04 and Debian 10
    - Outbound ports all open
    - Inbound ports open = 22, and 9934 (the port used by the server)

    Things I've tried
    - Building as Mono and IL2CPP
    - .NET 2.0 and .NET 4.0

    I start the server by running this shell-file:
    chmod +x Linux_Build.x86_64
    ./Linux_Build.x86_64 -batchmode -nographics -port_9934 -logfile unity.log​

    I've attached the logfile. Does anyone know what the solution is for this issue is? What am I missing?
    Been stuck on this for a few days now and it's starting to drive me crazy.. :rolleyes:
     

    Attached Files:

    Last edited: Sep 9, 2021
  2. Nexile_Erk

    Nexile_Erk

    Joined:
    Aug 30, 2021
    Posts:
    2
    I found the issue! The issue was my own stupidity! LiteNetLib uses UDP but I was using TCP portforwarding..... :oops:
     
    Joe-Censored likes this.
  3. qbvbsite

    qbvbsite

    Joined:
    Feb 19, 2013
    Posts:
    83
    That would do it lol
     
    Joe-Censored likes this.