Class for managing socket simple in c++