CSharp: Refactored SocketTest