sys/net/telnet: automatically disconnect after period of inactivity#17897
Closed
benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
Closed
sys/net/telnet: automatically disconnect after period of inactivity#17897benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
benpicco wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
gnrc_tcp can't detect if a connection was lost (not closed) so terminate the connection after a period of inactivity to prevent losing the socket forever if we lose the connection.
Contributor
Author
|
superseded by #13082 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
gnrc_tcpcan't detect if a connection was lost (not closed), so terminate the connection after a period of inactivity to prevent losing the socket forever if we lose the connection.Testing procedure
I tested this with
examples/telnet_serveronsame54-xprowhere I can easily trigger a loss of network connection by disconnecting the ethernet cable.Make sure to set
CONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MSto something lower than the default, otherwise you'll have to wait an additional 2 minutes forsock_tcp_disconnect()to return.telnet fe80::fec2:3dff:fe23:22df%eno1CONFIG_TELNET_AUTO_DISCONNECT_SEC) and an additional ~10s (or whatever you have set forCONFIG_GNRC_TCP_CONNECTION_TIMEOUT_DURATION_MS)telnet fe80::fec2:3dff:fe23:22df%eno1On
masterthe new connection can not be established as the server is still connected to the stale socket.With this patch you can connect to the server again.
Issues/PRs references
work-around for #17896