tcp socket now all refactored