Server not receiving message?

Hello,

I’m trying to send the client’s name to the server when he joins.
But the server never receives a message?

class RegisterHostMessage : MessageBase
{
    public string playerName;
}

public override void OnStartClient()
{

    if (isServer)
        return;

    string playerName = GameObject.Find("username").GetComponent<customName>().username;

    MasterClient mast = new MasterClient();
    mast.RegisterHost(playerName);

}

public override void OnStartServer()
{
    Debug.Log("Server Started");
    NetworkServer.RegisterHandler(123, OnMessage);
    Debug.Log("Registered Message");
}

class MasterClient
{
    public NetworkClient client;

    public void RegisterHost(string name)
    {
        client = new NetworkClient();
        RegisterHostMessage msg = new RegisterHostMessage();
        msg.playerName = name;
        client.Send(123, msg);
        Debug.Log("I SEND A MESSAGE");
    }
}

void OnMessage(NetworkMessage netMsg)
{
    Debug.Log("I GOT A MESSAGE"); //Never happens

    if (!isServer)
        return;

    Debug.Log("I AM THE SERVER");

    RegisterHostMessage msg = netMsg.ReadMessage<RegisterHostMessage>();

    //do stuff
}

Any Help??
Thanks in advance.

Can anybody help?