예제 #1
0
        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());
            }
        }
예제 #2
0
 public AuthentificationForm()
 {
     ctm = new ClientTopicsManager();
     ctm.SetServer("127.0.0.1", 26763);
     ctm.Connect();
     InitializeComponent();
 }
예제 #3
0
        public TopicForm(AuthentificationForm authentificationForm
                         , ClientTopicsManager ctm, Chatter c)
        {
            this.authentificationForm = authentificationForm;
            this.ctm = ctm;

            chatter = c;

            topicRooms = new Dictionary <string, ChatroomIHM>();

            InitializeComponent();
        }
예제 #4
0
        public MainForm(AuthentificationForm authentificationForm
                        , ClientTopicsManager ctm, Chatter c)
        {
            this.authentificationForm = authentificationForm;
            this.ctm = ctm;

            chatter = c;

            InitializeComponent();

            new Thread(Run).Start();
        }
예제 #5
0
        public InscriptionForm(ClientTopicsManager ctm)
        {
            this.ctm = ctm;

            InitializeComponent();
        }