moved the tcp client and insert to own file