Extend work done in commit 18a3c3a7 to earlier in the socket detection process Fixes issue #6 (closed).