TCP reset on remote connection failure #538
Open
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.
There is currently no possibility for a "simple" TCP client (i.e sending data and not expecting any particular feedback), to know that a remote end is not actually responding, because:
This is problematic when dealing with some remote write only devices that may or may not be up and running, as chisel is "hiding" the non availability of the devices.
As the chisel listening port will always be up, it is indeed impossible to have the same behaviour as when dealing directly with the device, but it is possible at some point to abruptly reset the TCP connection, so the client has a chance to catch an error.
This proposal implements the following changes for TCP connection:
Note: Resetting TCP connection requires attempting to write some data to the client, so the origin of error is used as data as well
With this change, a simple netcat to a Chisel input proxy towards a non reachable remote will now:
Example below.
Server log
Client logs
netcat