GetRemoteDelayTimeMS host id out of bound

I’m doing a simple message test, and put this code in my OnServerAddPlayer:

public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId) {
        base.OnServerAddPlayer(conn, playerControllerId);

        //Initialize the time sync message
        TimestampReceiveMessage timeMsg = new TimestampReceiveMessage();
        timeMsg.serverTimeStamp = NetworkTransport.GetNetworkTimestamp();

        conn.Send(TimestampReceiveMessage.id, timeMsg);

        Debug.Log("OnServerAddPlayer");
    }

And this is supposed to receive it:

//Used to create a sync time between clients
    public void ReceiveTimeStamp(NetworkMessage msg) {
        TimestampReceiveMessage message = msg.ReadMessage<TimestampReceiveMessage>();
        byte error;
        Debug.Log(NetworkTransport.GetRemoteDelayTimeMS(msg.conn.hostId, msg.conn.connectionId, message.serverTimeStamp, out error).ToString() + " MS Delay");
    }

But it seems that when the message is sent to itself (when the host is also a client) it gives me an error:
host id out of bound id {-1} max id should be greater 0 and less than {1}.

Is there any reason why? This does not happens to other clients connected to the host.
If there is no way to fix, is there any way to detect the conn is to myself?

Thanks in advance!

Also, testing with far away friends it always return “0 ms delay”.

So I’m guessing it is also broken for now…

HostId should be your own hostId AFAIK

NOTE

For late 2018 I found one of the problems, recently introduced by Unity.

Note the aside in RED near the middle. That’s the secret

“(Important aside. For late 2018 you must stop your client discovery above in OnClientConnect, directly after the call to the base. You actually can NOT do it in your discovery client.)”