created Sockets sample code using new and old C++ styles