(options: ServiceLaunchOptions)
| 2712 | } |
| 2713 | |
| 2714 | fn restart_detached_service(options: ServiceLaunchOptions) -> anyhow::Result<()> { |
| 2715 | if service::active()?.is_some() { |
| 2716 | return service::restart(ServiceOptions { |
| 2717 | port: options.port, |
| 2718 | bind: options.bind, |
| 2719 | advertise_host: options.advertise_host, |
| 2720 | client_root: options.client_root, |
| 2721 | video_codec: options.video_codec, |
| 2722 | android_gpu: options.android_gpu, |
| 2723 | low_latency: options.low_latency, |
| 2724 | stream_quality_profile: options.stream_quality_profile, |
| 2725 | local_stream_fps: options.local_stream_fps, |
| 2726 | access_token: None, |
| 2727 | pairing_code: None, |
| 2728 | }); |
| 2729 | } |
| 2730 | if let Some(metadata) = read_service_metadata()? { |
| 2731 | terminate_service_metadata(&metadata)?; |
| 2732 | } |
| 2733 | start_detached_service(options) |
| 2734 | } |
| 2735 | |
| 2736 | fn service_restart_port(explicit_port: Option<u16>) -> anyhow::Result<u16> { |
| 2737 | if let Some(port) = explicit_port { |
no test coverage detected