aboutsummaryrefslogtreecommitdiff
path: root/karld/src/interface/stdio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'karld/src/interface/stdio.rs')
-rw-r--r--karld/src/interface/stdio.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/karld/src/interface/stdio.rs b/karld/src/interface/stdio.rs
new file mode 100644
index 0000000..b10dfc0
--- /dev/null
+++ b/karld/src/interface/stdio.rs
@@ -0,0 +1,13 @@
+use log::{error, info};
+
+use crate::CLIENT_ID_COUNTER;
+
+use super::generic::generic_handle_connection;
+
+pub fn run() {
+ let id = CLIENT_ID_COUNTER.fetch_add(1, std::sync::atomic::Ordering::Relaxed);
+ info!("reading packets from stdin");
+ if let Err(e) = generic_handle_connection(id, std::io::stdin(), std::io::stdout()) {
+ error!("{e}");
+ }
+}