internal async void add(notifyport dv) { await locker.WaitAsync(); list.Add(dv); locker.Release(); }
internal async void remove(notifyport val) { await locker.WaitAsync(); list.Remove(val); locker.Release(); }
async void add(TcpClient tcp) { try { byte[] data = new byte[1]; await tcp.GetStream().ReadAsync(data, 0, data.Length); switch ((byteid)data[0]) { case byteid.questioner: { responder dv = new responder(this, tcp, privatekey); } break; case byteid.notifier: { notifyport dv = new notifyport(this, tcp, privatekey); } break; case byteid.clientspeed: { serverspeed dv = new serverspeed(this, tcp, privatekey); } break; default: { tcp.Close(); } break; } } catch { tcp?.Close(); } }