Update comment to reflect current code

pull/1/head
Jeffrey Esquivel S 6 years ago
parent e3174bf2a2
commit 6c3b8a5137
No known key found for this signature in database
GPG Key ID: 9020CB6FE67C1864
  1. 4
      examples/server.rs

@ -42,8 +42,8 @@ fn main() {
let socket = TcpListener::bind(&addr).unwrap(); let socket = TcpListener::bind(&addr).unwrap();
println!("Listening on: {}", addr); println!("Listening on: {}", addr);
// This is a single-threaded server, so we can just use Rc and RefCell to // Tokio Runtime uses a thread pool based executor by default, so we need
// store the map of all connections we know about. // to use Arc and Mutex to store the map of all connections we know about.
let connections = Arc::new(Mutex::new(HashMap::new())); let connections = Arc::new(Mutex::new(HashMap::new()));
let srv = socket.incoming().for_each(move |stream| { let srv = socket.incoming().for_each(move |stream| {

Loading…
Cancel
Save