Allows a timeout on socket connection (for sentinel?)
(cherry-picking a2814025b from tanguylebarzic)
not sure if necessary