Properly apply socket timeouts where appropriate (#1324)This should make the "missed 2 heartbeats" message less frequent and improve stability overall (commit: 3a9b2cd)