public DChatClient(string clientName) { this.clientName = clientName; // wire up client //DChatServer.onMsgArrived += new DChatServer.OnMsgArrived(onMsgArrived); DChatServer.ClientConnect(new DChatServer.OnMsgArrived(onMsgArrived)); }
private static void DelegateChatServerDemo() { Console.WriteLine("Demo start: Delegate Chat Server."); DChatClient cc1 = new DChatClient("1"); DChatClient cc2 = new DChatClient("2"); DChatClient cc3 = new DChatClient("3"); //DChatServer.SendMsg("Hi to all clients"); DChatServer.SendMsg("Hi to all clients", null); DChatServer.SendMsg("Hi to all clients except client 2", cc2); Console.WriteLine("Demo stop: Delegate Chat Server."); }