Exemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            client = new Scheme3();
            client.Start();
            client.Client.OnReceiveDataClient += OnReceiveDataHandler;
            Control.CheckForIllegalCrossThreadCalls = false;

            txtChat.ScrollBars = ScrollBars.Vertical;
        }
Exemplo n.º 2
0
 public void Start()
 {
     string nm = Datagen.GetFirstName();
     string msg = "";
     Client = new Scheme3();
     //client.HostName = "74.208.133.86";
     Client.HostName = "127.0.0.1";
     Client.EnableDataGenerator = false;
     Client.TimerInterval = 200;
     Thread t = new Thread(new ThreadStart(Client.StartClient));
     t.Start();
     msg = nm;
     Thread.Sleep(1000);
     string sendmsg = string.Format("LOGIN . CHAT/1.0\nname={0}\ncontent-length:{1}\n\n{2}\n\n", nm, msg.Length, msg);
     Client.Send(sendmsg);
     //while (inLoop)
     //{
     //    Thread.Sleep(1000);
     //    msg = Datagen.GetComment();
     //    client.Send(string.Format("SAY . CHAT/1.0\nname={0}\ncontent-length:{1}\n\n{2}\n\n", nm, msg.Length, msg));
     //}
     //t.Join();
 }