Refactor Internet Socket Test