mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
main: add "socket_timeout" var
This commit is contained in:
parent
43286685df
commit
af8b9d05df
1 changed files with 4 additions and 3 deletions
|
|
@ -9,17 +9,18 @@ use common::State;
|
|||
|
||||
fn main(){
|
||||
let addr = ([127, 0, 0, 1], 3000).into();
|
||||
let socket = network::create_socket(addr, 4096 * 8);
|
||||
let state = State::new();
|
||||
let socket = network::create_socket(addr, 4096 * 8);
|
||||
let socket_timeout = Duration::from_millis(1000);
|
||||
|
||||
for i in 1..4 {
|
||||
let socket = socket.try_clone().unwrap();
|
||||
let state = state.clone();
|
||||
|
||||
::std::thread::spawn(move || {
|
||||
network::run_event_loop(state, socket, i, Duration::from_millis(1000));
|
||||
network::run_event_loop(state, socket, i, socket_timeout);
|
||||
});
|
||||
}
|
||||
|
||||
network::run_event_loop(state, socket, 0, Duration::from_millis(1000));
|
||||
network::run_event_loop(state, socket, 0, socket_timeout);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue