Search Unity

How to connect to a server without hostId using LLAPI?

Discussion in 'Multiplayer' started by Horschty, Sep 14, 2017.

  1. Horschty

    Horschty

    Joined:
    Aug 10, 2016
    Posts:
    4
    In order to connect to a server I need to use the following function:
    NetworkTransport.Connect(hostId, ipAddress, port, 0, out error);
    But the hostId is only available for the client if server and client run inside the SAME unity process.
    What if I want to create a seperate server app that ONLY servers as server, relaying messages etc?
    Maybe even use a different language/framework like Node.js and run it on the same machine, so I setup Node.js to listen for connections on say port 3333 but I don't have a hostId when connecting with my Unity Client.
    Putting in 0 as hostId doesn't work since it somehow internally looks up if a Host has been created in the same process.
    Can anyone point me in the right direction?
     
  2. Njb_

    Njb_

    Joined:
    Jun 3, 2015
    Posts:
    20
    What i did is the client hosting dosent actually connect. When the server wants to send data to the client that is hosting, it just calls the methods locally.