chiark / gitweb /
wip server ipif
[hippotat.git] / server / slocal.rs
index 919c33882cb8a123bcb64d09aa091e8faeb9e86f..374849bc3d38ee9f222980f2472840ecc2cf4271 100644 (file)
@@ -5,8 +5,21 @@
 use super::*;
 
 #[allow(dead_code)] // xxx
-#[throws(PacketError)]
-pub async fn run(_global: &Global,
-                 _rx: mpsc::Receiver<RoutedPacket>) {
-  
+#[allow(unused_variables)] // xxx
+pub async fn run(global: Arc<Global>,
+                 rx: mpsc::Receiver<RoutedPacket>,
+                 mut ipif: Ipif) -> Result<Void,AE> {
+  let r = async {
+    loop {
+      select!{
+        data = ipif.tx.next_segment() =>
+        {
+          let data = data.context("read from ipif")?;
+        }
+      }
+    }
+  }.await;
+
+  ipif.quitting(None).await;
+  r
 }