Looks like this loop can be deleted, you already have a host_port filled array