Issue #37 / #40: Handle socket timeouts during socket writes.