예제 #1
0
 private void Notify(object sender, MessageArrivedArgs e)
 {
     // 今のところsenderは使わない
     if (!string.IsNullOrWhiteSpace(e.Message))
     {
         OnMessageArrived(e.Sender, e.Message);
     }
 }
예제 #2
0
        private void Poslusaj()
        {
            ConnectedClient cl = clients[clients.Count - 1];
            accepted = true;

            while ((!stopped) && cl.client.Connected)
            {
                string uk = "";
                try
                {
                    uk = cl.reader.ReadString();

                    try
                    {
                        MessageArrivedArgs maa = new MessageArrivedArgs(uk, cl.msgNum, cl);
                        MessageArrived(this, maa);
                    }
                    catch { }
                    cl.Messages.Add(uk);
                    cl.msgNum++;
                }
                catch
                {
                    StopClient(cl);
                }

                

            }
        }
예제 #3
0
        private void Poslusaj()
        {
            while (!stopped)
            {
                string uk = "";
                try
                {
                    uk = reader.ReadString();

                    try
                    {
                        MessageArrivedArgs maa = new MessageArrivedArgs(uk, msgNum);
                        MessageArrived(this, maa);

                    }
                    catch { }

                    Messages.Add(uk);
                    msgNum++;
                }
                catch {Stop(); }
                
            }
        }