static void Main(string[] args) { // Test de base de l'échange de messages entre serveur/client ClientTopicsManager client = new ClientTopicsManager(); try { client.setServer("127.0.0.1", 2453); client.connect(); client.createTopic("topic 1"); client.createTopic("topic 2"); List <String> topics = client.listTopics(); Console.WriteLine("The openned topics are : "); foreach (String topic in topics) { Console.WriteLine(topic); } Chatroom chatroom = client.joinTopic("topic 2"); Chatter chatter = new TextChatter("bob", "123"); chatroom.join(chatter); chatroom.post("nouveau message", chatter); Thread.Sleep(10000); chatroom.quit(chatter); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public AuthentificationForm() { ctm = new ClientTopicsManager(); ctm.SetServer("127.0.0.1", 26763); ctm.Connect(); InitializeComponent(); }
public TopicForm(AuthentificationForm authentificationForm , ClientTopicsManager ctm, Chatter c) { this.authentificationForm = authentificationForm; this.ctm = ctm; chatter = c; topicRooms = new Dictionary <string, ChatroomIHM>(); InitializeComponent(); }
public MainForm(AuthentificationForm authentificationForm , ClientTopicsManager ctm, Chatter c) { this.authentificationForm = authentificationForm; this.ctm = ctm; chatter = c; InitializeComponent(); new Thread(Run).Start(); }
public InscriptionForm(ClientTopicsManager ctm) { this.ctm = ctm; InitializeComponent(); }