Socket class for C++