Handle() public method

public Handle ( IPAddress localAddress, byte response, IPEndPoint endpoint ) : void
localAddress System.Net.IPAddress
response byte
endpoint System.Net.IPEndPoint
return void
示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }