1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

Arbiter::exec to start TcpServer will not work, simply call it (#118)

Fixes #115

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
This commit is contained in:
Daniel Egger 2020-01-27 15:17:14 +01:00 committed by Yuki Okushi
parent e50aecc953
commit fca1069b8a

View File

@ -1,5 +1,3 @@
use serde::{Deserialize, Serialize};
use std::time::{Duration, Instant}; use std::time::{Duration, Instant};
use actix::*; use actix::*;
@ -229,10 +227,7 @@ async fn main() -> std::io::Result<()> {
// Start tcp server in separate thread // Start tcp server in separate thread
let srv = server.clone(); let srv = server.clone();
Arbiter::new().exec(move || {
session::tcp_server("127.0.0.1:12345", srv); session::tcp_server("127.0.0.1:12345", srv);
Ok::<_, ()>(())
});
println!("Started http server: 127.0.0.1:8080"); println!("Started http server: 127.0.0.1:8080");