Add Socket client functions and test scripts