public Task Handle(IPAddress localAddress, UpnpDeviceInfo deviceInfo, IPEndPoint endpoint, NatProtocol protocol) { switch (protocol) { case NatProtocol.Upnp: var searcher = new UpnpSearcher(Logger, HttpClient); searcher.DeviceFound += Searcher_DeviceFound; return(searcher.Handle(localAddress, deviceInfo, endpoint)); default: throw new ArgumentException("Unexpected protocol: " + protocol); } }
public static async Task Handle(IPAddress localAddress, UpnpDeviceInfo deviceInfo, IPEndPoint endpoint, NatProtocol protocol) { switch (protocol) { case NatProtocol.Upnp: var searcher = new UpnpSearcher(Logger, HttpClient); searcher.DeviceFound += Searcher_DeviceFound; await searcher.Handle(localAddress, deviceInfo, endpoint).ConfigureAwait(false); break; default: throw new ArgumentException("Unexpected protocol: " + protocol); } }