Refactored CUDA SocketCommunication example