Answering myself, this works as expected.
I now simply use Arc::new(()) to count references.
> On 11/03/2020 6:45 PM Dietmar Maurer wrote:
>
>
> > > +Ok((sock, _addr)) => {
> > > +sock.set_nodelay(true).unwrap();
> > > +let _ = set_tcp_
> > +Ok((sock, _addr)) => {
> > +sock.set_nodelay(true).unwrap();
> > +let _ = set_tcp_keepalive(sock.as_raw_fd(),
> > PROXMOX_BACKUP_TCP_KEEPALIVE_TIME);
> > +let acceptor = Arc::clone(&acceptor);
> > +
> On Tue, Nov 03, 2020 at 02:25:21PM +0100, Dietmar Maurer wrote:
> > > > -let connections =
> > > > proxmox_backup::tools::async_io::HyperAccept(connections);
> > > > +let connections = accept_connections(listener, acceptor);
> > > > +let connections =
> > > >
On Tue, Nov 03, 2020 at 02:25:21PM +0100, Dietmar Maurer wrote:
> > > -let connections =
> > > proxmox_backup::tools::async_io::HyperAccept(connections);
> > > +let connections = accept_connections(listener, acceptor);
> > > +let connections =
> > > hyper::serv
> > -let connections =
> > proxmox_backup::tools::async_io::HyperAccept(connections);
> > +let connections = accept_connections(listener, acceptor);
> > +let connections =
> > hyper::server::accept::from_stream(connections);
>
> If we move the `from_stream` in
generally ACKed, but I have some notes:
On Tue, Nov 03, 2020 at 01:26:36PM +0100, Dietmar Maurer wrote:
> ---
>
> based, on Domink's patch, but with the following changes:
>
> - factor out code into separate function accept_connections()
> - no select with shutdown future (no needed)
> - rem
looks better than mine :)
comment inline
On 11/3/20 1:26 PM, Dietmar Maurer wrote:
---
based, on Domink's patch, but with the following changes:
- factor out code into separate function accept_connections()
- no select with shutdown future (no needed)
- remove sender2.send_timeout() -
---
based, on Domink's patch, but with the following changes:
- factor out code into separate function accept_connections()
- no select with shutdown future (no needed)
- remove sender2.send_timeout() - not sure why this was there?
- restict number of spawned tasks
Seems to work, but I get