copied pontarius echoclient example and done some modification