Move TCPSocket handling in a separate file.
Add a pure Socket implementation as well.