[PATCH 1/3] Added timeout to socket connections