private void EndDeleteAsync(IAsyncResult ar) { var mapping = (Mapping)ar.AsyncState; _device?.EndDeletePortMap(ar); _mappings.Remove(mapping.PrivatePort); }
private void EndRemoveMap(IAsyncResult result) { if (device == null) { return; } try{ device.EndDeletePortMap(result); logger.Info("UPnP successfully removed port map(" + map.Protocol + "/" + map.Port + ")"); } catch (MappingException e) { logger.Error("UPnP failed to remove map port(" + map.Protocol + "/" + map.Port + ")" + "Error: " + e.ErrorCode + " " + e.ErrorText); } }
private void EndRemoveUdpMap(IAsyncResult result) { try { INatDevice device = (INatDevice)result.AsyncState; device.EndDeletePortMap(result); logger.Info("UPnP successfully removed port map {0}", udpMapping); } catch (MappingException e) { logger.Error("UPnP failed to remove map port {0}. Error: {1}", udpMapping, e); } }
private static void EndDeleteAsync(IAsyncResult ar) { _device?.EndDeletePortMap(ar); }