server must join

This commit is contained in:
Y. T. Chung
2015-10-01 04:03:12 +08:00
parent b1034b650c
commit 10652fc68d
2 changed files with 9 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
[package]
name = "shadowsocks-rust"
version = "0.9.12"
version = "0.9.13"
authors = ["Y. T. CHUNG <zonyitoo@gmail.com>"]
[lib]

View File

@@ -262,11 +262,18 @@ impl TcpRelayServer {
impl TcpRelayServer {
pub fn run(&self) {
let mut futs = Vec::with_capacity(self.config.server.len());
for s in self.config.server.iter() {
let s = s.clone();
Builder::new().stack_size(COROUTINE_STACK_SIZE).spawn(move || {
let fut = Builder::new().stack_size(COROUTINE_STACK_SIZE).spawn(move || {
TcpRelayServer::accept_loop(s);
});
futs.push(fut);
}
for fut in futs {
fut.join().unwrap();
}
}
}