Skip to content

XSockets chat state

Uffe Björklund edited this page Jun 16, 2015 · 2 revisions

2 - Let's build a chat!

public string Name {get;set;}
public string Location {get;set;}

//we remove the override of onmessage with the method below
public void Say(string message)
{
    var m = new {Name, Location, Message = message};
    this.InvokeToAll(m,"say");
}

Try it with Putty once again... Now set the values for name and location by using
chat|set_name|Steve
chat|set_location|Oslo

Then send a message with
chat|say|hello putty world

next

Clone this wiki locally