Naive socket timeout implementation