update demo for socket version