-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We expect user to use systemd service to manage a daemon or to handle their process by themself. The json-rpc server is exposed only for unix systems through unix sockets, it is moved to its own module while the implementation for windows is marked as TODO.
- Loading branch information
1 parent
1b00cdf
commit 6ce083e
Showing
8 changed files
with
52 additions
and
156 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#[cfg(unix)] | ||
mod unix; | ||
|
||
use std::{ | ||
io, path, | ||
sync::{atomic::AtomicBool, Arc}, | ||
}; | ||
|
||
use crate::DaemonControl; | ||
|
||
#[cfg(unix)] | ||
pub fn run( | ||
socket_path: &path::Path, | ||
daemon_control: DaemonControl, | ||
shutdown: Arc<AtomicBool>, | ||
) -> Result<(), io::Error> { | ||
let listener = unix::rpcserver_setup(socket_path)?; | ||
log::info!("JSONRPC server started."); | ||
let res = unix::rpcserver_loop(listener, daemon_control, shutdown); | ||
log::info!("JSONRPC server stopped."); | ||
res | ||
} | ||
|
||
#[cfg(windows)] | ||
pub fn run( | ||
_socket_path: &path::Path, | ||
_daemon_control: DaemonControl, | ||
_shutdown: Arc<AtomicBool>, | ||
) -> Result<(), io::Error> { | ||
todo!("Implement a json rpc server over Named pipe"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters