implement test examples using sockets