diff options
Diffstat (limited to 'src/client/client.rs')
| -rw-r--r-- | src/client/client.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/client.rs b/src/client/client.rs index 2a5f595..cc4cea8 100644 --- a/src/client/client.rs +++ b/src/client/client.rs @@ -1,11 +1,12 @@ use gethostname::gethostname; -use std::net::IpAddr; +use std::{net::IpAddr, thread::sleep, time::Duration}; use whoami::{DesktopEnv, Language}; use crate::connector::Connection; pub struct Client<C: Connection> { pub connector: C, + ip: Option<IpAddr>, hostname: String, device_name: String, @@ -71,4 +72,11 @@ impl<C: Connection> Client<C> { c.connector.init(&c); c } + + pub fn enter_loop(mut self) -> ! { + loop { + sleep(Duration::from_millis(500)); + self.connector.tick(); + } + } } |
