summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2018-10-13 19:55:10 -0400
committerAaron Hill <aa1ronham@gmail.com>2018-10-17 21:18:33 -0400
commit978eb3b256f59fd024e9822cfa1d05b98548b033 (patch)
treefa6199477a04614344627acdcf56afd1be590472
parentc50c8ef27467616645ddc1aa22fa56fc0439ab6b (diff)
downloadroughenough-978eb3b256f59fd024e9822cfa1d05b98548b033.zip
Add send_to_self
-rw-r--r--src/bin/roughenough-server.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/roughenough-server.rs b/src/bin/roughenough-server.rs
index 5b8b65d..ad173e9 100644
--- a/src/bin/roughenough-server.rs
+++ b/src/bin/roughenough-server.rs
@@ -278,6 +278,10 @@ impl Server {
}
false
}
+
+ fn send_to_self(&mut self, data: &[u8]) {
+ self.socket.send_to(data, &self.socket.local_addr().unwrap());
+ }
}
fn polling_loop(config: Box<ServerConfig>, online_key: OnlineKey, cert_bytes: Vec<u8>) -> bool {
@@ -317,7 +321,6 @@ fn polling_loop(config: Box<ServerConfig>, online_key: OnlineKey, cert_bytes: Ve
.expect("failed setting Ctrl-C handler");
-
loop {
check_ctrlc!(kr_new);
if server.process_events() {