C++/TCPSocket: Refactor, add userdata for poller; support colored error message