Cleaned up tcp socket