Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection breaks down if nothing is sent for >= keep alive timeout #40

Open
chenlijun99 opened this issue Jul 10, 2022 · 2 comments
Open

Comments

@chenlijun99
Copy link
Contributor

I would expect Tinyproto to schedule some S frames as keep alive frames.

@lexus2k
Copy link
Owner

lexus2k commented Oct 27, 2022

Tinyproto already has this:

else if ( __time_passed_since_last_frame_received(handle, peer) > handle->ka_timeout )

If you consider a bug, let me know

@chenlijun99
Copy link
Contributor Author

Hi. Sorry for the lack of feedback.

Indeed, there is already a mechanism to send keep alive frames. I can see that sometimes it works, sometimes it doesn't. If I understand the code correctly, once a keep alive frame has been sent, if tiny_fd_connected_check_idle_timeout is immediately re-called (because tiny_fd_get_tx_data is immediately re-called), before the response to the keep alive frame is received, then we immediately enter this branch

if ( !handle->peers[peer].ka_confirmed )
{
LOG(TINY_LOG_CRIT, "[%p] No keep alive after timeout\n", handle);
__switch_to_disconnected_state(handle, peer);
}

and disconnection is asserted.

Maybe a sort of keepalive response timeout should be considered?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants