If SSLTunnel is killed when it still has some connections opened then the connections are closed but (at least on linux) remain in the TIME_WAIT state for a short time. This stops a subsequent instance of SSLTunnel from starting as it fails to bind to the still open socket. We can avoid this by setting the SO_REUSEADDR option before attempting to bind. This will allow rebinding an existing socket in the TIME_WAIT state. The alternative would be delaying for short times if unable to bind but this seems the most elegant solution.
Created attachment 420224 [details] [diff] [review] patch rev 1 Simple fix, just sets the Reuseaddr option on the socket before binding.
Assignee: nobody → dtownsend
Status: NEW → ASSIGNED
Attachment #420224 - Flags: review?(ted.mielczarek)
Attachment #420224 - Flags: review?(ted.mielczarek) → review+
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Whiteboard: [fixed220.127.116.11, fixed18.104.22.168]
You need to log in before you can comment on or make changes to this bug.