use SocketAgent interface

test on local machine.
NewClient will be better.