private static void GuidelinesBasedEventChatServerDemo() { GChatServer s1 = new GChatServer(); Console.WriteLine("\n\nDemo start: Guidelines Based Event Chat Server. Server: {0}", s1.ToString()); GChatClient cc1 = new GChatClient("1", s1); GChatClient cc2 = new GChatClient("2", s1); GChatClient cc3 = new GChatClient("3", s1); //s1.SendMsg("Hi to all clients"); s1.SendMsg("Hi to all clients", null); s1.SendMsg("Hi to all clients except client 2", cc2); Console.WriteLine("Demo stop: Guidelines Based Event Chat Server."); }
public GChatClient(string clientName, GChatServer gcs) { this.clientName = clientName; this.gcs = gcs; gcs.MsgArrivedHandler += new GChatServer.MsgArrivedEventHandler(this.onMsgArrived); }