Add passive socket timeout handling

Hello,

This is how we work around timeouts on passive socket (#85). Would you mind reviewing and pulling please?