Apologies if this is the incorrect place to ask for help! I'm attempting to grok some of the examples and just wondering if I'm reading something correctly..
In the proxy example, the code appears to connect to the remote server at every message?
let done = socket.incoming().for_each(move |(client, client_addr)| {
let server = TcpStream::connect(&server_addr, &handle); // ??
let amounts = server.and_then(move |server| {
// ...
});
// ...
Ok(())
});
Perhaps I'm making a mistake regard what socket is iterating over in the call to socket.incoming().for_each()? How many iterations per connection would one expect on a long lived connection?
Apologies if this is the incorrect place to ask for help! I'm attempting to grok some of the examples and just wondering if I'm reading something correctly..
In the proxy example, the code appears to connect to the remote server at every message?
Perhaps I'm making a mistake regard what socket is iterating over in the call to
socket.incoming().for_each()
? How many iterations per connection would one expect on a long lived connection?