Exemple #1
0
        private void AccepteClient(Socket client)
        {
            var        newClient     = new SimpleClient(client);
            ClientHost currentClient = new ClientHost(newClient);

            currentClient.Disconnected += ClientDisconnected;

            currentClient.AddFrame(new BasicFrame());
            currentClient.Send(new HelloConnectMessage());

            m_clients.Add(currentClient);
        }
Exemple #2
0
        private void bt_connect_Click(object sender, EventArgs e)
        {
            var newclient = new SimpleClient();

            client      = new ClientHost(newclient);
            client.name = tb_name.Text;
            client.AddFrame(new IdentificationFrame());
            newclient.Start(tb_IP.Text, 400);

            Thread.Sleep(500);

            if (!newclient.Runing)
            {
                MessageBox.Show("Connection Failed !");
            }
        }
Exemple #3
0
 private void HandleIdentificationSuccesMessage(ClientHost client, IdentificationSuccesMessage msg)
 {
     Program.ActualForm.FormConnected();
     client.RemoveFrame(typeof(IdentificationFrame));
     client.AddFrame(new ChannelFrame());
 }
Exemple #4
0
        private void bt_connect_Click(object sender, EventArgs e)
        {
            var newclient = new SimpleClient();
            client = new ClientHost(newclient);
            client.name = tb_name.Text;
            client.AddFrame(new IdentificationFrame());
            newclient.Start(tb_IP.Text, 400);

            Thread.Sleep(500);

            if (!newclient.Runing)
                MessageBox.Show("Connection Failed !");
        }