added sockets sample code  (some depracated)