add echo from pthread to associated sockfd.Need to rewrite to simplify the codes