Issue #122: simplify socket timeout logic