-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move unix socket server in its own module
- Loading branch information
1 parent
626f678
commit 1a511e9
Showing
3 changed files
with
33 additions
and
6 deletions.
There are no files selected for viewing
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"); | ||
} |
File renamed without changes.
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