examples from tutorial: sockets