diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 35c839d..002bfe8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,12 +7,16 @@ async fn main() -> Result<(), Box<dyn Error>> { dotenv::dotenv().ok(); pretty_env_logger::init(); - loop { - tokio::spawn(async move { - let _ = AutoServer::new("0.0.0.0:6650").await; - }); - tokio::spawn(async move { - let _ = RoomServer::new("0.0.0.0:5673").await; - }); + let mut threads = vec![]; + threads.push(tokio::spawn(async move { + let _ = AutoServer::new("0.0.0.0:6650").await; + })); + threads.push(tokio::spawn(async move { + let _ = RoomServer::new("0.0.0.0:5673").await; + })); + for thread in threads { + let _ = thread.await; } + + Ok(()) }
\ No newline at end of file |