Hi Joey--

On 12/08/2008 04:49 AM, Joey Hess wrote:
> If redir is interrupted while attempting to open a tcp connection to a
> server that is not currently reachable, the following can happen:
 [...]
> After a minute or so, the lport frees up, and redir can be started again.

Thanks for the report.  This is indeed an annoying behavior.

> IIRC, this kind of problem can be avoided by. Possibly by using SO_LINGER? I 
> forget..
> FWIW, simpleproxy does not have this problem.

socat also appears to have this misbehavior, though it can be avoided by
supplying the reuseaddr option to the listening socket.  Looking at the
socat source, it appears that this is related to the SO_REUSEADDR option.

It's not clear to me if this should be implemented automatically for
every listening connection for redir, or if it warrants an additional
command-line option.  I'm inclined to avoid additional command line
options (the UI is already too clumsy and ill-structured).  Can you
think of a scenario where it would be a bad thing to have either of
these socket options set?

        --dkg

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to