mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-01-18 07:43:01 +08:00
Mac Wakeup using caffeinate
This commit is contained in:
parent
5b3b7bd3c0
commit
d244551ad8
@ -104,6 +104,11 @@ async fn accept_connection_(server: ServerPtr, socket: Stream, secure: bool) ->
|
||||
if let Ok((stream, addr)) = timeout(CONNECT_TIMEOUT, listener.accept()).await? {
|
||||
stream.set_nodelay(true).ok();
|
||||
let stream_addr = stream.local_addr()?;
|
||||
if cfg!(target_os = "macos") {
|
||||
use std::process::Command;
|
||||
Command::new("/usr/bin/caffeinate").arg("-u").arg("-t 2").output().expect("failed to execute caffeinate");
|
||||
println!("wake up macos...");
|
||||
}
|
||||
create_tcp_connection(server, Stream::from(stream, stream_addr), addr, secure).await?;
|
||||
}
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user