TODO
Ensure socket closes on timeout