Example #1
0
        private void ThreadExecute(object data)
        {
            SocketClientSync client = (SocketClientSync)data;
            string           read   = null;

            while (client.Connected)
            {
                read = client.Read(500);

                if (client.LastException != null)
                {
                    if (!(client.LastException is TimeoutException))
                    {
                        UpdateList("Read Error! " + client.LastException.Message);
                        client.Disconnect();
                    }
                }
                else
                {
                    if (read != null)
                    {
                        CheckMsg(read);
                    }
                }

                Thread.Sleep(11);
            }
        }