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); }
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 !"); } }
private void HandleIdentificationSuccesMessage(ClientHost client, IdentificationSuccesMessage msg) { Program.ActualForm.FormConnected(); client.RemoveFrame(typeof(IdentificationFrame)); client.AddFrame(new ChannelFrame()); }
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 !"); }