Closed nick1udwig closed 2 hours ago
Are you sure? My understanding of the select statement here is that the timeout is actually dropped if one of the other branches (send or receive) completes first
Thinking closely about this actually makes me slightly concerned that sent/received messages could be dropped if they occur near-simultaneously here -- need to check.
Sorry, missed the notif here.
Are you sure? My understanding of the select statement here is that the timeout is actually dropped if one of the other branches (send or receive) completes first
You're right, but because both read and write are infinite loops that only break on error, I think this leads to non-erroring connections having fixed lifetimes unrelated to their activity. This isn't terrible, but could be improved by keeping active connections alive.
you're right -- i'll fix
https://github.com/Enigma-Dark/kinode-engagement/issues/18#issuecomment-2481725115
funny enough--looks like we're better off forcing reconnections (after 30 minutes!) as a way to rotate session keys
lol nice
If we ever want to run Kinode on a phone, we'll probably want to have much shorter-lived connections (to save on the "keep-alive" ping battery costs), but we can always revisit this if that becomes something we're actually considering implementing.
Currently,
net
connections timeout after some fixed period of time, e.g.:https://github.com/kinode-dao/kinode/blob/main/kinode/src/net/tcp/utils.rs#L85
It would be better if they instead timed out after a period of time since last message.
We should also consider whether the current timeout of 30m is appropriate. Should it be shorter?