optimization: getConnectedBalancePorts