private void Notify(object sender, MessageArrivedArgs e) { // 今のところsenderは使わない if (!string.IsNullOrWhiteSpace(e.Message)) { OnMessageArrived(e.Sender, e.Message); } }
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); } } }
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(); } } }