Network.peerType == Incorrect

I have a piece of code that runs in a Monobehavior’s Start Method. The method checks the Network.peerType, however whenever I do so the result is always Disconnected - even when connected. I have hacked the solution below, but, I was wondering if there was a more elegant solution.

 void Start()
{
    Invoke("AfterStart", 1);
}

void AfterStart()
{
    if (Network.peerType != NetworkPeerType.Disconnected)
    {
        networkView.RPC("OnSetIdentity", RPCMode.OthersBuffered,"TestName");
    }
}

What if you put it in OnConnectedToServer() if you’re the client, or OnClientConnected() if you’re the server, setting a flag that you’ve done it if you only want it done once?