public static void handleObserver(string router, UTodoJsonObject jsonObject) { var clients = observers[router]; foreach (var client in clients) { client.ClientSocket.Send(UTodoMessage.PackMessage(jsonObject)); //todo error } }
public void on(string route, Action <UTodoJsonObject> callback) { var data = UTodoMessage.PackMessage("on." + route); clientSocket.BeginSend(data, 0, data.Length, SocketFlags.None, SendCallback, callback); }
public void notify(string route, UTodoJsonObject jsonObject) { var data = UTodoMessage.PackMessage("notify." + route, jsonObject); clientSocket.BeginSend(data, 0, data.Length, SocketFlags.None, SendCallback, null); }