socket programinng with c#
How many clients can connect to the server? What is the server code is written?

  

> Blockquote

  private void btnserverconect_Click(object sender, EventArgs e)
        {
            Form1_Load(sender, e);
       }
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
               
                //IPAddress local = IPAddress.Parse("127.0.0.1");
                EndPoint destination = new IPEndPoint(IPAddress.Any, 8000);
                server.Bind(destination);
                server.Listen(5);
                Thread wait = new Thread(wa);
                wait.Start();
            }
            catch (Exception)
            {
                MessageBox.Show("connection error !");
            }
        }
        void wa()
        {
            label1.Text = "please wait...";
           server=  server.Accept();
            label1.Text = "connect";
            while (true)
            {
                try
                {
                    byte[] by = new byte[100];
                    int n = server.Receive(by);
                    lstserver.Items.Add("client :"+Encoding.ASCII.GetString(by, 0, n));
                }
                catch (Exception)
                {        
            }}}
socket programinng with c#
===

How many clients can connect to the server? What is the server code is written?

  

> Blockquote

  private void btnserverconect_Click(object sender, EventArgs e)
        {
            Form1_Load(sender, e);
       }
        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
               
                //IPAddress local = IPAddress.Parse("127.0.0.1");
                EndPoint destination = new IPEndPoint(IPAddress.Any, 8000);
                server.Bind(destination);
                server.Listen(5);
                Thread wait = new Thread(wa);
                wait.Start();
            }
            catch (Exception)
            {
                MessageBox.Show("connection error !");
            }
        }
        void wa()
        {
            label1.Text = "please wait...";
           server=  server.Accept();
            label1.Text = "connect";
            while (true)
            {
                try
                {
                    byte[] by = new byte[100];
                    int n = server.Receive(by);
                    lstserver.Items.Add("client :"+Encoding.ASCII.GetString(by, 0, n));
                }
                catch (Exception)
                {        
            }}}