Search Unity

[LLAPI] Multiple hosts on the same machine

Discussion in 'Multiplayer' started by Tuni, Jul 12, 2017.

  1. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    Hi,

    I'm messing around with the LLAPI of UNET. How does the Unity HLAPI create hosts if you run multiple instances of your game on the same machine? If I do this with my implementation I get an error that the websocket is already in use. My workaround is to use different ports in the editor and in the build.

    Greetings

    Tuni
     
  2. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    different ports.

    i have a debug scene that loads in before my game which has a menu where i can specify a port if i need to switch it.

    if you're looking to automate it somewhat, you could choose a starting port, then just sequentially test like the next 10 ports to see if they're in use.
     
  3. Tuni

    Tuni

    Joined:
    May 24, 2013
    Posts:
    74
    Thank you!