diff options
author | natrixaeria <janng@gmx.de> | 2019-05-18 05:52:08 +0200 |
---|---|---|
committer | natrixaeria <janng@gmx.de> | 2019-05-18 05:52:08 +0200 |
commit | f3983341be939235c1a6cd522b3bb5cc318a6d1a (patch) | |
tree | 58465cb955128ee87314c568c752733689db16c8 | |
parent | d6b0f07eb5170812ed642c9adc1af310fefcea9a (diff) |
Keep client connections open
and start the server on localhost
-rw-r--r-- | game_server/src/gameserver.rs | 1 | ||||
-rw-r--r-- | game_server/src/main.rs | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/game_server/src/gameserver.rs b/game_server/src/gameserver.rs index 377654e..9334a27 100644 --- a/game_server/src/gameserver.rs +++ b/game_server/src/gameserver.rs @@ -83,6 +83,7 @@ impl GameServer { fn add_client(&self, mut client: GameClient) { std::thread::spawn(move || { println!("Token: {:?}", client.require_token()); + loop { std::thread::sleep(std::time::Duration::from_millis(100)); } }); } diff --git a/game_server/src/main.rs b/game_server/src/main.rs index d8a7b53..e129283 100644 --- a/game_server/src/main.rs +++ b/game_server/src/main.rs @@ -12,7 +12,7 @@ use backend_connection::BackendConnection; fn main() { pretty_env_logger::init(); - let addr = ("0.0.0.0", 5001); + let addr = ("127.0.0.1", 5001); info!("create game server on {:?}", addr); let gameserver = gameserver::GameServer::new(addr); gameserver.run().unwrap(); |