New -autotoss option

John Goerzen
2021-01-07T21:33:56Z

Hi Sergey,

Thanks again for the new version. I've been experimenting with
-autotoss.

At first it didn't seem to do anything in nncp-caller, but after
killing the remote nncp-daemon, it went on to do the toss.

I think that waiting for the remote end to hang up might delay
things; I have a very large onlinedeadline and timeout. I think
pseudo code like this might do the trick:

loop forever
needstoss = false
if remote.has_packets_for_us()
needstoss = true
process_packets
when ! remote.has_packets_for_us()
if needstoss
toss
needstoss = false

In other words, every time we transition in state from "remote
host has packets for us" to "remote host no longer has packets for
us", we toss. This could also be very nice even for 10-second
onlinedeadlines, because it might allow a toss and response to be
sent even within that window regularly.

What do you think?

- John