protected sealed override async void Accepted(IStation station, string message, StationDesc src) { _station = station; string rst = await Invoked(message); await station.Send(MsgType.Signal, rst).To(src); station.Close(); }
private async void handlePong(string msg, StationDesc src) { station.Log($"{msg} from {src.Name}"); if (--cnt == 0) { await station.Send(MsgType.Block, "").To(ponger); station.Close(); return; } ping(); }
protected sealed override async void Accepted(IStation station, string message, StationDesc src) { _station = station; station.Signaled += (string msg, StationDesc _) => { _tcs.TrySetResult(msg); }; Next = src; var rst = await Invoked(message); await station.Send(MsgType.Signal, rst).To(Next); station.Close(); }
public void Open(IStation station, string[] args) { this.station = station; if (args.Length > 0 && Int32.TryParse(args[0], out var c)) { this.cnt = c; } station.Grab(ponger).Signaled += handlePong; station.Send(MsgType.Link, "").To(ponger); if (this.cnt > 0) { ping(); } else { station.Close(); } }