C++ network code