move test for end of target list into while condition
pass port in sockaddr_in->sin_port to create_rpc_client